问题
I know this is going backwards - but I would like to convert a web application back into a website. I want to do this because there are/will be many people working on it and we like to be able to update just a single page without having to compile/deploy the entire project.
My environment is Visual Studio 2012/ASP.Net 3.5/c#
回答1:
The following worked for me:
- Delete the
.sln, .suo, .csproj, .csproj.user,*.debug.config,*.release.configand any other project/solution related files. - In Visual Studio, choose
File -> Open -> Websiteand browse to the project folder. The folder you want is typically the one where theglobal.asaxanddefault.aspxpages are in (root). - Open it up.
- Click on the newly generated Solution at the root of your Solution explorer.
- Choose
File -> "Save xxxxxx.sln As..."and save the new*.slnsomewhere. - Rename your
App_Startfolder toApp_Code.
These steps are just based on a quick experiment I did with a basic new WebForms web application project.
Depending on the complexity or type of your project, you may need additional steps.
In essence, you are just trying to strip away the "project" files and recreating a Solution file.
来源:https://stackoverflow.com/questions/24146465/visual-studio-convert-web-application-to-website