empty website and git
hi as am a newbie to GIT with visual studio ,
I’m working with an n-tier website with multiple projects and at first i make it as an empty website , so the visual studio make a directory to the solution in Projects folders for VS2012 at documents and The BLL and DAL and the website pages itself at websites directory for visual studio main directory .
so when i trying to add the solution the source control this message shown up :
the current solution has projects that are located outside the solution folder.
there projects will not be source controlled in the git repository.
to add all the projects to a single Git repository please consolidate all projects under a single folder
- Deployment to Azure from Jenkins not working because of “A network-related or instance-specific error occurred” (Error 26)
- Git asks me for password Each and every time I want to commit and push my project
- Why is Auto Resolve conflicts on by default in Visual Studio 2012?
- Configure vsdiffmerge for multiple files at once
- Visual Studio not showing Git commit options in context menu
- Jenkins MSTestRunner plugin is unable to launch mstest.exe
i tried to copy the website into my solution folder but nothing happened of course 😀
how can i make this work ?
2 Solutions collect form web for “empty website and git”
You can delete the website from the solution in visual studio, and then ‘add existing project’ to solution. Otherwise create a new empty website and enter the solution directory as the location for the website instead of the default location.
I had the same problem with Visual Studio 2015 and the website templates for .NET Framework 4 (Looks like this has been sorted for templates targeting 4.5).
This is how I got the files from the template into the project
- Click File -> New -> Web site
- Select Templates -> Visual C# -> ASP.NET Web Forms Site
- Leave Web location as File System and choose a folder. I used C:\Users\tim\Documents\Visual Studio 2015\Projects\WebSite4
- Click OK
You’ll now see in Windows Explorer there are two folders WebSite4 and WebSite4 (2). The second folder has the sln file and packages folder.
- Create a folder in WebSite4 (2) called Website
- Copy the contents of Website4 into WebSite4 (2)\Website
Return to Visual Studio
- In Solution Explorer, right click WebSite4 and then click Remove. Click OK to confirm.
- Right click Solution, click Add -> Existing Website.
- Select the folder WebSite4 (2)\Website and click Open.
Bonus – rename the solution
10. Right click Solution ‘WebSite4 (2)’ and click Rename. Remove the (2)
Bonus – rename the folder
- Rename the folder
- Close the solution
- Rename the folder in Windows Explorer
- Open -> Project/Solution
Once that was all done I was able to publish the project to a remote git repository through Team Explorer.