问题
We inherited a website that is ~40GB in size (mostly from user-submitted content) that has a mixture of classic ASP, inline .Net and and compiled .Net associated with it. There are technically two sites associated with this and to conserve disk space I intentionally setup IIS to have two physical sites pointing to the same folder, but with independent application pools to separate the worker processes.
The problem we're running into is occasionally when you visit one of the sites it seems to pickup Application variables from the other site somehow. From everything I've seen on here/Bing, the worker processes should be separate because of the independent application pools but I'm wondering if classic ASP is throwing that off somehow? Given the mixture of everything imaginable (there are ~4,200 physical .asp/.aspx files with the latter mostly starting off with 03_ because that was the method chosen to start migrating to .Net before I got involved), is it better to have these as independent sites and folders? I can't seem to figure out why Application variables are getting flipped mid-stream, but it's causing numerous problems - specifically because connection strings are also application variables and there are two databases behind this thing.
Any tips? Does classic ASP work differently from an Application variable/worker process perspective?
Side note - I know Application variables are a terrible choice in the .Net world, especially for connection strings. I'm in the process of trying to rectify this, but it's a massive undertaking where zero documentation or comments exist and these things are used everywhere.
回答1:
Unless there is intentional exchange between Classic ASP site and NET application** even running on the same site(!!!) but separate app pools for obvious reason, for example using application variable for storing values, there is no way that Classic asp would pass variable to NET application. Even session variable is not shared between Classic ASP and NET. It has to be done intentionally in code.
For example if you using iframe and passing variable in url string from NET app to classic ASP page or back or just calling NET app from classic ASP page and passing variables in URL string or verse versus.
** Or using cookies to share values between application if you running under same domain.
来源:https://stackoverflow.com/questions/23157016/classic-asp-asp-net-application-variables