【问题标题】:Visual Studio 2013/2015/2017 profiler adds Not publishable lines in web.config?Visual Studio 2013/2015/2017 探查器在 web.config 中添加不可发布的行?
【发布时间】:2014-06-24 19:05:21
【问题描述】:

今天我只是在 Instrumentation 模式下使用 Visual Studio 的分析器分析我的 WCF 应用程序。后来我需要发布到我的网络服务器,突然我收到一条错误消息,提示找不到 Microsoft.VisualStudio.Enterprise.AspNetHelper 文件路径。

当我查看我的 web.config 时,我看到分析会话添加了以下行。

  <system.web>
<compilation targetFramework="4.0" debug="true" assemblyPostProcessorType="Microsoft.VisualStudio.Enterprise.Common.AspPerformanceInstrumenter, 
Microsoft.VisualStudio.Enterprise.AspNetHelper, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>


      <runtime>
<generatePublisherEvidence enabled="false"/>

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.VisualStudio.Enterprise.AspNetHelper" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
            <codeBase version="12.0.0.0" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2012.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.AspNetHelper.DLL"/>
            </dependentAssembly></assemblyBinding></runtime>

<appSettings>
<!--<add key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation" value="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\vsinstr.exe"/>-->
</appSettings></configuration>

很明显,它会在服务器上查找一些 DLL,但是由于未安装 VS,因此该路径在服务器上无效,因此会引发异常。为什么会发生这种情况以及如何避免在 web.config 中添加这些行?每次进行分析会话时删除这些行会很麻烦。

更新: 这个问题也出现在 VS2015 上。如果你启动 VS 分析工具,它会在 web.config 中添加一行

>   <add
> key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation"
> value="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team
> Tools\Performance Tools\vsinstr.exe"/>    <dependentAssembly>
>               <assemblyIdentity name="Microsoft.VisualStudio.Enterprise.AspNetHelper" 
> culture="neutral"/>
>               <codeBase version="14.0.0.0" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2014.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.AspNetHelper.DLL"/></dependentAssembly>

如果你发布到服务器,你会在下面得到这个错误

Configuration error

描述:处理配置文件时出错 这是此请求所必需的。查看具体的错误详情 下面并适当地修改您的配置文件。

解析器错误消息:文件或程序集 'Microsoft.VisualStudio.Enterprise.AspNetHelper,版本 = 14.0.0.0, Culture = 中立,PublicKeyToken = "或其之一 未找到依赖项。系统找不到指定的文件。

来源错误:

服务器上出现应用程序错误。由于目前的习俗 此应用程序的错误设置 应用程序的详细信息 可以显示远程错误(出于安全原因)。然而,他们 可以通过本地服务器上运行的浏览器查看。

源文件:C:\www\web.config 线路:52

Load Trace Assembly:可以通过以下信息确定, 为什么要组装 Microsoft.VisualStudio.Enterprise.AspNetHelper, 版本 = 14.0.0.0,文化 = 中性,PublicKeyToken = b03f5f7f11d50a3a 无法加载。

警告:程序集绑定日志记录已关闭。您可以启用日志记录程序集 绑定失败,删除注册表值【HKLM\Software\Microsoft\ 融合! EnableLog] (DWORD) 为 1 组。注意:程序集绑定日志记录 错误会导致一定的性能损失。你可以转这个 功能关闭,删除注册表值 [HKLM\Software\Microsoft\ 融合!启用日志]。

【问题讨论】:

  • 您好,这是 Visual Studio Profiler 团队,这绝对是一个错误。您能否在connect.microsoft.com/VisualStudio提交连接错误并包括您的开发操作系统版本、VS 版本、IIS 版本、IIS 主机操作系统版本等信息。
  • @AndreHamilton 我会在星期一填写一份错误报告,但我也遇到了这个问题,所以它仍然是一个问题,而不仅仅是一个人。
  • 在VS2015 R3还是有问题
  • VS2015 R3 对我来说还是个问题
  • 在 VS2017 (15.6.0) 中仍然存在问题 刚刚在运行 Profiler 之前检查了我的 web.config,它起到了一种魅力。修复这个微软!

标签: visual-studio-2015 visual-studio-2013 visual-studio-2017 web-config profiler


【解决方案1】:

在我的情况下,这是 Visual Studio Profiler 的问题。它会检查 web.config 中的本地 exe 路径。我在 web.config 中评论了以下 2 行,它解决了我的问题。

<!--<compilation debug="true" targetFramework="4.5" assemblyPostProcessorType="Microsoft.VisualStudio.Enterprise.Common.AspPerformanceInstrumenter, Microsoft.VisualStudio.Enterprise.AspNetHelper, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>-->
<!--<add key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation" value="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\vsinstr.exe"/>-->

【讨论】:

  • 你真的读过这个问题吗?你在重复我上面写的内容,你的回答与问题无关
【解决方案2】:

我遇到了问题:使用分析器后无法设置断点。分析器用上述 2 行更改了 web.config。注释掉关键行,将编译行改回原来的:

<compilation defaultLanguage="c#" debug="true" targetFramework="4.5.2">

问题解决了,我可以设置断点,一步步调试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-29
    • 1970-01-01
    • 2012-08-17
    相关资源
    最近更新 更多