[英]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. 我正在Vim中编写这个程序,现在我正在考虑迁移到Visual Studio,但由于我首先没有在Visual Studio中启动,所以没有.sln文件可以打开。 How should I open such a project in Visual Studio?
我应该如何在Visual Studio中打开这样的项目?
If you have a web project (without a .sln), you must do: 如果您有一个Web项目(没有.sln),您必须:
Menu File → Open → Web 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. 如果存在* .csproj文件,则可以首先使用Visual Studio构建新的解决方案。 Next, you can open this *.csproj file in Visual Studio.
接下来,您可以在Visual Studio中打开此* .csproj文件。
The simplest way to do this (assuming this is not a web project, as indicated in another answer) would most likely be to: 最简单的方法(假设这不是一个Web项目,如另一个答案中所示)最有可能是:
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: Visual Studio中更简单的方法是遵循以下方法:
Menu File → New → Project from existing code 菜单文件 → 新建 → 现有代码中的项目
Choose the source file location and a .csproj and .sln file is created. 选择源文件位置,然后创建.csproj和.sln文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.