Is it possible to configure VirtualPathProviders with a relative physicalPath? Like this:
<add name="SitePageFiles" virtualName="Page Files" virtualPath="~/PageFiles/" physicalPath="..\..\VPP\PageFiles" indexingServiceCatalog="Web" showInFileManager="false" bypassAccessCheck="false" type="EPiServer.Web.Hosting.VirtualPathVersioningProvider, EPiServer"/>
I have tried but I have not got it to work.
Hmm... it should accept any value that the constructor of the DirectoryInfo class accepts but I think it is a big unknown what the current directory is for the thread...
But you can use environmental variables since Environment.ExpandEnvironmentVariables are called.
So it would be possible to use:
I've set upp an environmental variable to the VPP-folder. The ASPNET account has modify access to it. Still I get an "UnauthorizedAccessException" when I start my application. The exception in swedish: Åtkomst till sökvägen %KULING-VPP%\PageFiles nekas. The same exception was thrown when I tried with relative paths (..\..\).
Tried again after an IIS-reset. Now the environmental variable is recognized.
So now it works. Thanks a lot Fredrik.