加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

ASP.NET编译器抱怨MiniProfiler不匹配的框架版本

发布时间:2020-12-16 00:31:13 所属栏目:asp.Net 来源:网络整理
导读:我有一个MVC3项目,我从VS2010升级到VS2012。该项目还引用了MiniProfiler。我们的应用程序在VS2012中编译并运行良好,无任何警告/错误。使用IIS Express运行时,两个程序集都会正常运行。但是,当使用ASP.NET编译器工具时,我会收到以下警告: Microsoft (R)
我有一个MVC3项目,我从VS2010升级到VS2012。该项目还引用了MiniProfiler。我们的应用程序在VS2012中编译并运行良好,无任何警告/错误。使用IIS Express运行时,两个程序集都会正常运行。但是,当使用ASP.NET编译器工具时,我会收到以下警告:

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): 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,
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(我们的应用程序)。可能会导致此警告?

解决方法

我终于可以用 this answer的提示修复它了。我添加了以下< add>在web.config中的行:
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <!-- etc... -->
        <add assembly="System.Data.Linq,PublicKeyToken=b77a5c561934e089" />
        <!-- etc... -->
      </assemblies>
    </compilation>
  <system.web>
</configuration>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读