I have an existing directory structure that is all nicely checked into SVN, so I don't really want to mess with it.
The website code lives in a folder called C:\Projects\TheProject\Website. I want to bring the website files into a new Web Application Project without changing the directory structure.
Ideally the resulting file structure would look like this:
No matter what I try I dont get what I want. There is no option to create a web application from existing code. This is very frustrating. Does anyone know if it is possible?
On the File menu, select New > Project From Existing Code. Specify your project location, the directory for your source files, and the kinds of files the wizard imports into the new project.
Go to File > Open > Web Site. Select your website path and click Open. It will open website under new solution.
OK I figured it out. It's weird, but the following steps will work:
Use the following settings:
Name: Website (this is the name of the existing folder with the website files in it) Location: C:\Temp\ (anywhere will do for now) Solution Name: TheProject (name of the existing project's root folder) Check "Create directory for solution"
Delete the auto-created Default, Global and Web.config files
In Windows Explorer, copy the new folder on top of the existing folder so that the files are merged.
Double click on the sln file to open Visual Studio again.
Select "Show all files" (at the top of Solution Explorer)
Right click on any files or folders you want to add and select Include in Project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With