I work on a .NET web application, targeting multiple .NET and IIS versions, that is delivered with a web.config file. We've been able to use the same web.config file for most setups, but we have one line that is giving us trouble.
One of our /configuration/system.web/handlers needs to specify a path to the aspnet_isapi.dll.
<remove name="ASP.Net-ISAPI-Wildcard" /> <add name="ASP.Net-ISAPI-Wildcard" path="*" verb="*" type="" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" allowPathInfo="false" preCondition="runtimeVersionv2.0" responseBufferLimit="4194304" />
As you can see, the path points directly to a framework version, which causes problems since some people are 32-bit users (who use
Microsoft.Net\Framework) and others are 64-bit users (
who use Microsoft.Net\Framework64).
Is there an environment variable, like
%windir%, that I can use to specify the path to the right framework version, without having to hard-code a path to the .NET DLLs?