Category Archives: IIS

Multiple versions of Microsoft.Web.Administration.dll in IIS 10

On some Windows 10 machine with IIS 10 installed I have three Microsoft.Web.Administration.dll:

Two versions 7.0.0.0 and 7.9.0.0 in GAC (C:\Windows\assembly\GAC_MSIL\Microsoft.Web.Administration\) in 7.0.0.0__31bf3856ad364e35 and 7.9.0.0__31bf3856ad364e35 folders respectively and one version 7.0.0.0 in C:\Windows\System32\inetsrv\.

The following XML element in a Visual Studio project file adds a reference to version 7.0.0.0 of Microsoft.Web.Administration.dll:

<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
    <HintPath>%WINDIR%\System32\inetsrv\Microsoft.Web.Administration.dll</HintPath>
    <Private>True</Private>
</Reference>

The same XML element with SpecificVersion=False will automatically reference the highest available version on this machine that is 7.9.0.0.

(more…)

How to debug classic ASP with VS2015 and IIS Express

Change configuration/system.webServer/serverRuntime/asp section of $(SolutionDir).vs\config\applicationhost.config file to:

<asp scriptErrorSentToBrowser="true" enableParentPaths="true" bufferingOn="true" errorsToNTLog="true" appAllowClientDebug="true" appAllowDebugging="true">
    <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
    <session allowSessionState="true" />
    <limits />
</asp>

Open the website in a browser and then in VS2015 go to Debug->Attach To Process, change code type to Script and select iisexpress.exe. After that in browser navigate to a page you want to debug and Script Documents section will appear in Solution Explorer allowing you to set breakpoints on listed pages. Actually you do all the steps described in this post, except that you edit not the global IIS Express configuration, but local configuration located in VS2015 solution subdirectory .vs\config.

Links: