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.
- In the config file I changed
<compilation debug="true">
to<compilation debug="true" targetFramework="4.0">
in the system.web section - In the config file I changed
<providerOption name="CompilerVersion" value="v3.5" />
to<providerOption name="CompilerVersion" value="v4.0" />
in the compilers section - In Global.asax.cs I added
ViewEngines.Engines.Add(new RazorViewEngine());
to theApplication_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
How to Use Jwt in MVC Application for Authentication and Authorization
How to Make Smtp Authenticated in C#
How to Get the HTML Output of a Usercontrol in .Net (C#)
How to Display Formatted Code in Webpage
Httplistener with Https on Monotouch
Printing to a Client Printer from a Web App
What Setup Code Should Go in Form Constructors Versus Form Load Event
Alternatives to System.Drawing for Use with ASP.NET
How to Manipulate Images at the Pixel Level in C#
Disable Mouse Wheel on Itemscontrol in Wpf
C# Httpwebrequest Command to Get Directory Listing
SQL Error: Incorrect Syntax Near the Keyword 'User'
What's the Hardest or Most Misunderstood Aspect of Linq
Constructor of an Abstract Class in C#
How to Create Deterministic Guids
Getting HTML Body Content in Winforms Webbrowser After Body Onload Event Executes