I'm trying to move assembly redirects from web.config
into an external file. The reason for it is that I want to keep binding redirect in one place and use it on both debug and production configurations.
It sort of works, but I'm strugling with specifying relative paths.
<configuration>
<!-- this works, but forces me to use the same path on dev and production machines -->
<linkedConfiguration href="file://c:\data\web.runtime.config"/>
<!-- none of those works -->
<linkedConfiguration href="file://web.runtime.config"/>
<linkedConfiguration href="file://..\web.runtime.config"/>
<linkedConfiguration href="file://~/web.runtime.config"/>
</configuration>
I want to keep the web.runtime.config
in the same folder as the rest of the web application. Is it possible to specify a relative path in linkedConfiguration
element?
More info:
I've tested it with IIS Express and ASP MVC application in VS 2015. When monitoring file accesses using SysInternals Process Monitor relative pathes seems to resolve to \\web.runtime.config
(an invalid network path), while when using the absolute path no leading \\
is added.