简体   繁体   中英

NO .csproj file in my asp.net core project

I am doing c# programming course (building ASP.NET Core application) right now that is almost 1year old. The guy created web API application and class libraries and in those projects there was project.JSON files. I know that instead of the project.json file there is a .csproj file now but when I create my own project in VS 2017 asp.net core there is no such a file like .csproj. I need to set dependencies but I don't know how without.csproj file. Where can I find this file?

Visual Studio doesn't display the file since the project itself is the csproj file.

You can right-click on it and select the Edit … action to edit the csproj file. You can also use the NuGet package manager to edit dependencies.

Previously (VS 2015), the project that VS used was an .xproj file and the project.json was displayed because it was "part of" that project.

As @Martin said in his answer

Visual Studio doesn't display the file since the project itself is the csproj file.

In case the Edit is not shown when you right-click on the project in the Solution explorer,you can:

  1. Right Click on the project in the Solution Explorer. Unload Project
  2. Right Click on the project in the Solution Explorer. Edit ProjectName.csproj
  3. Edit what you want and save
  4. Right Click on the project in the Solution Explorer. Reload Project

文件 > 添加 > 新项目(当您的解决方案 .sln 被选中时)

You can edit the .csproj or .vbproj file by the following ways:

  1. Go to the project folder. Inside this folder, there is another folder which has the same name as the project. The .csproj or .vbproj file can be found inside this folder. For example: C:\\\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj

  2. Right click the project in Visual Studio Solution Explorer. You can see the option Edit project file . Using this option will open the project file inside Visual Studio editor.

  3. Right click the project in Visual Studio Solution Explorer. Select Unload Project . Right click the project again in the Solution Explorer. You can see the Edit Project_Name.csproj file option. Using this option will open the project file inside Visual Studio editor. After editing reload the project in Solution Explorer.

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