Search code examples
asp.netvisual-studio-2010iisvirtual-directory

Is it possible to make App_GlobalResources a virtual directory?


Bad design aside, I have a web application that has dependencies on several folders in another web application. I've successfully made virtual directories for bin, several folders under App_Code folder, but I'm having trouble with creating a virtual directory for App_GlobalResources. I'm getting

"App_GlobalResources maps to a directory outside this application"

error when building my app.

NOTE I do not have the trailing slash at the end of the directory in IIS. My environment is Windows Server 2003 32 bit, Visual Studio 2010.


Solution

  • I would be surprised if this worked as I believe that .NET loads up non-compiled resource files using physical (but relative) paths. So, my first instinct would be to say that you cannot remap the resource folders using virtual paths. However, you could play other tricks like using an NTFS junction point. I would highly, highly recommend against this as you will shock the hell out the person that discovers this solution but in theory it would let you map App_GlobalResources to something else.