在 IIS 中更改应用程序的物理路径. With APPCMD you can add, modify and delete Virtual Directories and Virtual Applications.
To change the physical path of a virtual application:
appcmd.exe set app "Default Web Site/app" -[path=’/’].physicalpath:C:\path
Where:
应用程序 is the name of your application;
path to app is the location where your app is located. In case there are spaces in the application name, or directory structure, use quotes.
appcmd.exe set app "Default Web Site/App" -[path=’/’].physicalpath:"C:\inetpub\wwwroot\Web App"