我有一个项目,我已经更新
编译我尝试使用或设置@ViewBag.Title属性时收到错误.
无法找到编译动态表达式所需的一种或多种类型.您是否缺少对Microsoft.CSharp.dll和System.Core.dll的引用?
我做了以下事情
我不知道还能做什么?
编辑:
我注意到在GAC Gui中有System.Core 3.5.0.0但没有System.Core 4.0.0.0.这是否意味着它变得困惑并仍在使用以前的版本?或者我误解了GAC?
编辑:
我的web.config看起来如下
...
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add …Run Code Online (Sandbox Code Playgroud) 我有一个ASP.NET MVC 5 Web应用程序.在每个.cshtml视图文件中,我收到Viewbag的以下错误:无法找到编译动态表达式所需的一个或多个类型.你错过了参考吗?
我引用了Microsoft.CSharp.dll和System.Core.dll.
这是我的根web.config文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="***" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="RouteDebugger:Disabled" value="true" />
</appSettings>
<system.web>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<globalization culture="ro-RO" uiCulture="ro" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthenticationModule" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> …Run Code Online (Sandbox Code Playgroud)