One or More Types Required to Compile a Dynamic Expression Cannot Be Found. Are You Missing References to Microsoft.Csharp.Dll and System.Core.Dll

One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?

On your solution explorer window, right click to References, select Add Reference, go to .NET tab, find and add Microsoft.CSharp.

Alternatively add the Microsoft.CSharp NuGet package.

Install-Package Microsoft.CSharp

Why am I getting 'One or more types required to compile a dynamic expression cannot be found.'?

Okay I got it working with the following steps.

  1. In the config file I changed <compilation debug="true"> to <compilation debug="true" targetFramework="4.0"> in the system.web section
  2. In the config file I changed <providerOption name="CompilerVersion" value="v3.5" /> to <providerOption name="CompilerVersion" value="v4.0" /> in the compilers section
  3. In Global.asax.cs I added ViewEngines.Engines.Add(new RazorViewEngine()); to the Application_Start() method

and I think that was it.

One or more types required to compile a dynamic expression cannot be found

Dynamic keyword requires .Net Framework 4.0. (and DLR).
Windows Phone 7 (and 8) has it's own version of .Net Framework. And dynamic language runtime is not included.

So, you can't use it for Windows Phone development.

Warning messages in VS 2010 with MVC 4 about missing references to Microsoft.CSharp.dll & System.Core.dll

I believe what happened is that the web.config file got saved in unicode format and the version of mvc had a weird character in it so it was hidden from view. Once I deleted that character, it all worked again.



Related Topics



Leave a reply



Submit