Hi
I have two web sites defined in windows 2003 IIS. The first contains the App_Code, App_Data, etc folders for .NET 2.0 framework. I have put some code into the App_Code folder, which I don't really want to generate a dll for. I now want to re-use this code in
the second web server, so I thought, logically, that I could simply create a virtual directory and point it to the physical folder that is in the first website.
However, I now get the following error
The path '/App_Code/' maps to a directory outside this application, which is not supported
Has anyone got any idea how I can get around this without having to create a dll from the source code, as this is a right royal pain in the behind ![]()
Thanks
Darrell
-
-
Why can't you just copy the source file to a new App_Code directory on the 2nd virtual server?
____________Compilr - the online compilr C#, C, VB.NET, Fortran
http://thehackman.blogspot.com/">http://thehackman.blogspot.com -
The only problem with this is it means I have duplicated code all over the place. Now with two web sites this isn't that much of an issue, however, the client I am working for has over 40 different web sites, all of which could benefit from re-using the code that I have created in this method.
Any other ideas
Thanks
D
-
I don't think it can be done without a DLL.In the web.config file there is a section codeSubDirectories:
<configuration> <system.web> <compilation> <codeSubDirectories> <add directoryName="/mysite/code/mySubDir"/> </codeSubDirectories> </compilation> </system.web> </configuration>
However, the paths have to be relative to the App_Code file of the application.
It shouldn't take you too long to make a DLL although you still have multiple copies of the DLL in App_Bin directories unless you put it in the GAC? or whatever you have to do I think.
____________Compilr - the online compilr C#, C, VB.NET, Fortran
http://thehackman.blogspot.com/">http://thehackman.blogspot.com -
Perhaps enabling parent paths on the website will work. What you want to do is really what dlls are for. Keep you code in one place and deploy multiple dlls.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.