5

I have a project targeted to .Net 4.0. It used to build till yesterday. I looked at code and referenced assemblies. I can see the Extension attribute defined. Anyone has any clue about it.

I referred following questions but no help - "Missing compiler required member" error being thrown multiple times with almost no changes to code

enter image description here

enter image description here

* UPDATE 1: * I see Npgsql is defining ExtensionAttribute in the same namespace. When I removed and added older version of Npgsql, it built. What should I do to use latest Npgsql?

enter image description here

Community
  • 1
  • 1
Codie
  • 464
  • 2
  • 5
  • 16
  • Did you change target 4.0 -> 4.5? or referenced 4.5x assembly? – Alexei Levenkov Dec 10 '14 at 07:50
  • Had similar issue when my .net4 project referenced a .net3.5 assembly, and both of them have defined extension methods. – Alex Skalozub Dec 10 '14 at 07:51
  • @AlexeiLevenkov, No change in target. All assemblies are of 4.0 or less – Codie Dec 10 '14 at 07:55
  • @AlexSkalozub, you are right I inspected all referenced assemblies. Please see my update 1 – Codie Dec 10 '14 at 07:58
  • 1
    They have libs for different .net versions from 2.0 to 4.5. Using the correct one should fix your problem. If you added it with nuGet, then try re-adding the package. – Alex Skalozub Dec 10 '14 at 08:06
  • @AlexSkalozub, that is the answer. Somebody in my team must have added a version that is compiled against 2.0 to our internal repo. I added a new one targeted to 4.0 and it worked. thanks a lot! – Codie Dec 10 '14 at 10:01

1 Answers1

4

This happened to me recently, and my research kept coming back to problems with JSON.Net not targeting the correct version.

If you are using it, I would suggest removing it from your references, and removing the lines from your packages.config that also reference it. Then re-install it through NuGet and compile.