Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Missing compiler required member" error being thrown multiple times with almost no changes to code

Tags:

c#

asp.net-mvc

Today after deploying some changes to a C# MVC site that I run, I went back to make some more modifications and came across this error:

Missing compiler required member System.Runtime.CompilerServices.ExtensionAttribute..ctor

The error is a bit vague (other than it's description, obviously) as it doesn't give me a file, line, or column to reference, only the project. Also, it throws the error a total of 20 times. I only made three changes to the code between the time I deployed (it was completely functional at that time) and now. I reverted my changes and it is still throwing the same error which makes no sense to me.

I haven't found a lot of information on this error on SO or Google, other than this guys solution and a couple references to some Mono project errors (I'm not using Mono). The solution the guy above gives requires adding a class definition that will allow the compiler to resolve the reference. I don't particularly want to do this because I haven't needed to do it up until this point and it will just muddy my code.

Just curious if anyone has run across this before. Thanks in advance!

like image 363
jamesmillerio Avatar asked May 31 '11 03:05

jamesmillerio


2 Answers

In my case it was because the project was not referencing Microsoft.CSharp. Once I added a reference to that assembly, it compiled just fine.

like image 55
Mike Avatar answered Oct 24 '22 18:10

Mike


I don't know if anyone else has experienced this, but I suddenly ran into this error after adding some code utilizing dynamic types and incorporating WebAPI into a project that originated as a TypeScript application in VS2013. Simply adding a reference to Microsoft.CSharp resolved my issue.

Hope this helps someone else.

like image 88
H Boyce Avatar answered Oct 24 '22 17:10

H Boyce