Oggi stavo appena profilando la mia applicazione WCF usando il profiler di Visual Studio in modalità Instrumentation. Successivamente ho avuto bisogno di una pubblicazione sul mio server web e improvvisamente ricevevo un errore che diceva che non è stato possibile trovare il percorso del file Microsoft.VisualStudio.Enterprise.AspNetHelper.Il profiler di Visual Studio 2013/2015 aggiunge righe non pubblicabili in web.config?
quando ho rivisto il mio web.config, ho visto che le seguenti righe sono state aggiunte dalla sessione di profilazione.
<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>
E 'molto evidente che sembra per alcune DLL sul server, ma dal momento che questo percorso non è valido sul server come non è installato VS, viene generata un'eccezione. Perché sta succedendo e come evitare che queste righe vengano aggiunte nel web.config? Sarà piuttosto ingombrante rimuovere queste righe ogni volta che eseguirò una sessione di profilazione.
UPDATE: Questo problema si verifica anche su VS2015. Se si avvia VS strumento di profiling, Si aggiunge una linea in 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>
e se si pubblica al server, si ottiene questo errore sotto
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].
Ciao, questo è il team di Visual Studio Profiler e questo è sicuramente un bug. Potete presentare un bug di connessione e includere informazioni tra cui la versione del vostro sistema operativo, la versione VS, la versione di IIS, la versione del SO host IIS ecc. All'indirizzo https://connect.microsoft.com/VisualStudio/ –
@AndreHamilton Compilerò un bug report Lunedì, ma ho appena incontrato questo problema, quindi è ancora un problema e non solo l'una persona. – Kyle
In VS2015 R3 è ancora un problema –