How to deploy ASP. NET programs in a common folder
Problem description:
An Asp.net web program (Path: D: \ proj \ webtest). If a virtual directory (such as virtualapp) is used to point to it (D: \ proj \ webtest), http: // localhost/virtualapp/index. aspx can be accessed normally. However, if you move the web program to another folder (D: \ proj \ webtest \ ABC ),
Http: // localhost/virtualapp/ABC/index. aspx cannot be accessed normally. The following error message is displayed.
A server error occurs in the "/virtualapp" application.
--------------------------------------------------------------------------------
Configuration Error
Note: An error occurred while processing the configuration file required to provide services to the request. Check the following error details and modify the configuration file as appropriate.
Analyzer error message: the section registered as allowdefinition = 'machinetoapplication' outside the application level is incorrect. This error may occur because the virtual directory is not configured as an application in IIS.
Source error:
Row 23: "forms", "Passport", and "NONE"
Row 24: -->
Row 25: <authenticationmode = "Windows"/>
Row 26:
Row 27:
Source File: e: \ ASPnet \ webapplicationcsharp \ WEB. config row: 25
If. if you comment out <authenticationmode = "Windows"/> In the config file, the system prompts that the DLL file generated after the web program compilation cannot be found (codefile mode) or the corresponding page code file cannot be read (codebehind mode) error.
Do Asp.net programs have to be deployed in virtual directories? If you have purchased a service space and the space service provider does not release multiple virtual directories, how can you deploy multiple applications on a website?
Cause:
The essence of a virtual directory is "application domain ". When the application is executed, it will go to the bin directory under the execution directory to find the Execution Code. The bin directory is in the D: \ proj \ webtest \ ABC directory, and the application execution directory is D: \ proj \ webtest. Therefore, the DLL cannot be found.
Solution:
Move the bin directory of the application to the execution directory of the application. If there are multiple web applications, pay attention to the DLL file name conflict.To solve this problem, copy the bin directory under the D: \ proj \ webtest \ ABC directory to the D: \ proj \ webtest directory.