简体   繁体   中英

How do I open a project without a .sln file in Visual Studio?

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?

If you have a web project (without a .sln), you must do:

Menu FileOpenWeb Site...

And choose the folder where the project is.

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.

The simplest way to do this (assuming this is not a web project, as indicated in another answer) would most likely be to:

  1. Create a new project (of the desired type), which should also create the solution for it to live within.
  2. In the solution explorer, right click and select "Add > Existing item..."
  3. 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.

An even simpler way in Visual Studio is to follow this:

Menu FileNewProject from existing code

Choose the source file location and a .csproj and .sln file is created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM