November Happy Hour will be moved to Thursday December 5th.

VirtualPathProvider - relative physicalpath

Vote:
 

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. 

Regards Hans

#23099
Aug 27, 2008 8:18
Vote:
 

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:

physicalPath="%TEMP%\VPP\PageFiles"

/Fredrik

#23177
Aug 29, 2008 22:58
Vote:
 

Thanks Fredrik!

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 (..\..\).

Any idea?

/Hans

 

#23286
Sep 02, 2008 16:49
Vote:
 

Tried again after an IIS-reset. Now the environmental variable is recognized.

So now it works. Thanks a lot Fredrik.

/Hans

#23308
Sep 03, 2008 8:14
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.