9

Heute habe ich gerade meine WCF-Anwendung mit dem Profiler von Visual Studio im Instrumentationsmodus erstellt. Später musste ich auf meinem Webserver veröffentlichen und plötzlich bekam ich eine Fehlermeldung, dass der Microsoft.VisualStudio.Enterprise.AspNetHelper Dateipfad nicht gefunden werden konnte.Visual Studio 2013/2015 Profiler fügt nicht publizierbare Zeilen in web.config hinzu?

Wenn ich mein web.config überprüft habe, habe ich gesehen, dass folgende Zeilen von Profiling-Sitzung hinzugefügt wurden.

<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> 

Es ist sehr offensichtlich, dass es für einige DLLs auf dem Server aussieht, aber da dieser Pfad auf dem Server nicht gültig ist als VS nicht installiert ist, wirft es eine Ausnahme. Warum passiert das und wie vermeidet man, dass diese Zeilen in der web.config hinzugefügt werden? Es wird ziemlich umständlich sein, diese Zeilen jedes Mal zu entfernen, wenn ich eine Profilerstellungssitzung mache.

UPDATE: Dieses Problem tritt auch auf VS2015 auf. Wenn Sie VS Profilierungswerkzeug zu starten, wird eine Zeile in die 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> 

und wenn Sie auf dem Server veröffentlichen, werden Sie diesen Fehler unter

Configuration error 

Description: An error occurred while processing a configuration file that is needed for this request. Check the specific error details below and modify your configuration file appropriately.

Parser Error Message: File or assembly 'Microsoft.VisualStudio.Enterprise.AspNetHelper, Version = 14.0.0.0, Culture = neutral, PublicKeyToken = "or one of its dependencies not found. The system can not find the file specified.

Source Error:

Application error occurred on the server. Due to the current custom error settings for this application the details of the application error remotely (for security reasons) can be displayed. However, they can be viewed by browsers running on the local server.

Source File: C: \ www \ web.config Line: 52

Load Trace Assembly: can be determined with the following information, why the assembly Microsoft.VisualStudio.Enterprise.AspNetHelper, Version = 14.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a could not be loaded.

WRN: Assembly binding logging is OFF. You can enable logging assembly bind failure, remove the registry value [HKLM \ Software \ Microsoft \ Fusion! EnableLog] (DWORD) to 1 set. Note: Assembly binding logging error leads to a certain loss of performance. You can turn this feature off, remove the registry value [HKLM \ Software \ Microsoft \ Fusion! EnableLog].

+1

Hallo, das ist das Visual Studio Profiler-Team und das ist definitiv ein Fehler. Kannst du bitte einen Verbindungsfehler einreichen und Informationen wie deine Version des Betriebssystems, die VS Version, die IIS Version, die Version des IIS Host Betriebssystems usw. unter https://connect.microsoft.com/VisualStudio/ eingeben. –

+0

@AndreHamilton Ich fülle a aus Fehlerbericht am Montag, aber ich bin gerade auf dieses Problem gestoßen, also ist es immer noch ein Problem und nicht nur die eine Person. – Kyle

+0

In VS2015 R3 ist es immer noch ein Problem –

Antwort

3

In meinem Fall war es das ist Problem mit Visual Studio Profil. Es wird nach dem lokalen Exe-Pfad in web.config gesucht. Ich habe die folgenden 2 Zeilen in web.config kommentiert und es hat mein Problem gelöst.

<!--<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"/>--> 
+0

Haben Sie die Frage tatsächlich gelesen? Du wiederholst was ich oben geschrieben habe und deine Antwort hat nichts mit der Frage zu tun – batmaci