我得到了这个例外:

系统配置ConfigurationErrorsException:配置的值

我应该怎么做才能解决这个问题呢?

推荐答案

我遇到了类似的问题,不得不告诉ASP.NET在配置中通过修改Web.config使用3.5编译器.

我已经从我的代码中复制并粘贴了以下内容.你必须change value="v3.5" to value="v4.0"美元.compiler type个字符串也可能会改变.

<configuration>

  <!--  ... other configuraiton stuff ... -->

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v3.5"/>
        <providerOption name="OptionInfer" value="true"/>
        <providerOption name="WarnAsError" value="false"/>
      </compiler>
    </compilers>
  </system.codedom>

</configuration>

在我的例子中,使用的是2.0编译器,而不是3.5.我当时在一个IIS7,ASP.NET网站项目中工作.

您可以从以下方面获得其他见解:

Asp.net相关问答推荐

在 AppConfig.json 中存储对象的最佳方式

如何在 IIS 上配置 Web Deploy 发布功能,以便开发人员可以发布?

从数据库中检索数据的最快方法

System.Web.Helpers.Crypto - 盐在哪里?

模型项的类型为 CookMeIndexViewModel,但需要类型为 IEnumerable 的模型项

在 ASP.NET 中更改错误消息的语言

多个 DataContext 类是否合适?

如何从 asp:Repeater 循环遍历项目模板中的项目?

多行文本框多个换行符

确定哪个 w3wp.exe 进程属于 Windows 7 / IIS7.5 中的哪个 App Pool?

ASP.NET Core 中的 NuGet 包位置在哪里?

如何在 ASP.NET 中通过 LAN 访问您的网站

ContentResult 与字符串

在 ASP.NET MVC 中模拟 User.Identity

Application_Start 和 Application_OnStart 之间的区别

IronRuby死了吗?

x-powered by是什么意思?

如何解决我的 ASP.Net MVC 应用程序中的 iisreset 后发生的 AntiForgeryToken 异常?

ASP.NET 邮箱验证器正则表达式

jQuery Ajax 调用 - 成功设置变量值