Why am I Getting 'One or More Types Required to Compile a Dynamic Expression Cannot Be Found.'

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.

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

This is because you are missing a reference to Microsoft.CSharp. To add this reference, on your solution explorer window, right click to References, select Add Reference, go to .NET tab, find and add Microsoft.CSharp.

This will solve your problem.

Excel worksheets error: One or more types required to compile a dynamic expression cannot be found

Try removing the "Microsoft.CSharp" reference then add it back your project.



Related Topics



Leave a reply



Submit