ASP.NET编译器抱怨不匹配的框架版本,MiniProfiler [英] ASP.NET Compiler complaining of mismatching framework versions with MiniProfiler

查看:124
本文介绍了ASP.NET编译器抱怨不匹配的框架版本,MiniProfiler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我升级从VS2010到VS2012的MVC3项目。该项目还引用了 MiniProfiler 。我们的应用程序编译并运行良好的VS2012没有任何警告/错误。与IIS防爆preSS运行时,这两个组件加载的罚款。当使用ASP.NET编译工具,但是,我得到以下警告:

I have an MVC3 project that I upgraded from VS2010 to VS2012. The project also has a reference to MiniProfiler. Our application compiles and runs fine in VS2012 without any warnings/errors. Both assemblies load fine when running with IIS Express. When using the ASP.NET Compiler tool, however, I get the following warning:

微软(R)ASP.NET编译工具版本4.0.30319.17929工具   以precompile ASP.NET应用程序版权所有(C)微软   公司。保留所有权利。

Microsoft (R) ASP.NET Compilation Tool version 4.0.30319.17929 Utility to precompile an ASP.NET application Copyright (C) Microsoft Corporation. All rights reserved.

(0):警告:以下组件具有相关性的一个版本,   .NET框架是比目标高,可能无法加载   正常运行时导致失败:MiniProfiler,   版本= 2.1.0.0,文化=中性公钥= b44f9351044011a3。该   依赖关系:System.Data.Linq程序,版本= 4.0.0.0,文化=中立,   公钥= b77a5c561934e089。您应该保证   依赖程序集是正确的目标框架,或确保   目标框架你讲话的是,相关的   装配。

(0): warning : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: MiniProfiler, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3. The dependencies are: System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.

我们没有明确提及将System.Data.Linq 。直到更新VS2012,我们没有任何错误。该 MiniProfiler 版本确实是针对.NET 4.0(这是我们的应用程序)。这可能是导致此警告?

We don't have an explicit reference to System.Data.Linq. Up until the update to VS2012, we didn't have any errors. The MiniProfiler version is indeed targeting .NET 4.0 (as is our application). What could be causing this warning?

推荐答案

我终于能够从这个答案小费修复。我增加了以下<添加>在的web.config

I was finally able to fix it with a tip from this answer. I added the following <add> line in the web.config:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <!-- etc... -->
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <!-- etc... -->
      </assemblies>
    </compilation>
  <system.web>
</configuration>

这篇关于ASP.NET编译器抱怨不匹配的框架版本,MiniProfiler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆