问题
I was writing this program all in Vim and now I'm thinking of moving to Visual Studio, but since I didn't start in Visual Studio in the first place, there is no .sln file to open from. How should I open such a project in Visual Studio?
回答1:
If a *.csproj file exists, you can build a new solution by Visual Studio at first. Next, you can open this *.csproj file in Visual Studio.
回答2:
If you have a web project (without a .sln), you must do:
Menu File → Open → Web Site...
And choose the folder where the project is.
回答3:
An even simpler way in Visual Studio is to follow this:
Menu File → New → Project from existing code
Choose the source file location and a .csproj and .sln file is created.
回答4:
The simplest way to do this (assuming this is not a web project, as indicated in another answer) would most likely be to:
- Create a new project (of the desired type), which should also create the solution for it to live within.
- In the solution explorer, right click and select "Add > Existing item..."
- Insert all individual files that belong in this new project.
It's probably also worth noting that it's a good idea to double check the project setting, namespaces, etc. before you get too far with building up your project to avoid potential issues later.
来源:https://stackoverflow.com/questions/17713037/how-do-i-open-a-project-without-a-sln-file-in-visual-studio