Questions tagged [csproj]

A file with the 'csproj' file extension is a Visual Studio .NET C# Project file.

1084 questions
199
votes
10 answers

How to edit .csproj file

When I am compiling my .csproj file using .NET Framework 4.0 MSBUILD.EXE file, I am getting an error: "lable01" not found in the current context of "website01.csproj". Actually, I need to add every ASP.NET page with its code-behind file's reference.…
lock
  • 4,762
  • 10
  • 40
  • 89
198
votes
3 answers

What is "Service Include" in a csproj file for?

In a C# solution, I added a existing project. After that, Visual Studio has added the following entry in other .csproj files: What's this for? Can I delete…
joe
  • 7,264
  • 7
  • 45
  • 73
180
votes
6 answers

Designer Added then removed by Visual Studio on load/unload

Anyone see this before? I have a large Visual Studio project that keeps adding [Subtype]Designer[/Subtype] to my .vcproj then removing it on the next open and close of the project. There is only one class defined in StoredImageControl.cs. Anyone…
Jeff Lundstrom
  • 1,811
  • 2
  • 11
  • 5
160
votes
8 answers

In a .csproj file, what is for?

How is different from ?
Emmett
  • 13,097
  • 12
  • 52
  • 78
139
votes
9 answers

Your project does not reference ".NETFramework,Version=v4.6.2" framework. Add a reference to ".NETFramework,Version=v4.6.2" in the "TargetFrameworks"

I can't run my unit tests. I have the next error: Your project does not reference ".NETFramework,Version=v4.6.2" framework. Add a reference to ".NETFramework,Version=v4.6.2" in the "TargetFrameworks" property of your project file and then…
132
votes
6 answers

How do I get .NET Core projects to copy NuGet references to the build output?

I'm trying to write a plugin system with .NET Core, and one of my requirements are to be able to distribute the plugin DLL along with its dependencies to the user for install. However, I can't figure out how to include my NuGet dependencies as a…
chyyran
  • 2,026
  • 2
  • 18
  • 27
99
votes
1 answer

Relationship between the dotnet cli and the new vs2017 msbuild

With the move from project.json to the new csproj format introduced with VS2017, I'm struggling to understand the difference between the dotnet cli and the new msbuild and when to use one over the other. 1) To build a new csproj netstandard library…
kimsagro
  • 11,093
  • 14
  • 45
  • 59
98
votes
4 answers

How do you multi-target a .NET Core class library with csproj?

When .NET Core still used the project.json format, you could build a class library targeting multiple frameworks (e.g. net451, netcoreapp1.0). Now that the official project format is csproj using MSBuild, how do you specify multiple frameworks to…
Gigi
  • 24,295
  • 20
  • 85
  • 170
93
votes
8 answers

Is there a way to automatically include content files into asp.net project file?

I'm frequently adding a lot of content files (mostly images and js) to my ASP.NET project. I'm using VS publish system, and on publish, new files are not published until I include them in the project. I would like to auto include all files in…
Marko
  • 5,239
  • 2
  • 25
  • 47
91
votes
7 answers

Including content files in .csproj that are outside the project cone

I have a C# project say MyProject.csproj located at "C:\Projects\MyProject\". I also have files that I want copied into the output directory of this project. But, the files are at the location "C:\MyContentFiles\", i.e. they are NOT within the…
Poulo
  • 1,401
  • 2
  • 14
  • 20
87
votes
5 answers

Can files be nested in VS2017 Solution Explorer for .NET Core (non-ASP.NET Core) projects?

In "old school" MSBuild projects - as still used by Windows Forms in VS2017 for example - files could be "nested" via a DependentUpon item in the csproj file. I used this to group unit tests together in Noda Time, e.g.
Jon Skeet
  • 1,261,211
  • 792
  • 8,724
  • 8,929
82
votes
12 answers

Cannot find command 'dotnet ef'?

I am using .NET core 2.0 on Arch VScode and trying to get EF tools to work but I keep getting that error 'cannot find command dotnet ef'. I've just about looked everywhere and none of the suggestions worked. So if you can please help that would be…
Wasiim Ouro-sama
  • 1,185
  • 1
  • 9
  • 13
80
votes
20 answers

Detected package downgrade warning (dotnet core, vs 2017)

I have just updated all my nuget packages for my solution (dotnet core 1.1 project). I am now getting the following warnings and I don't really know what they mean. Update: I am still getting warnings mentioned above. My web projects warn about…
Nik
  • 1,935
  • 3
  • 19
  • 28
73
votes
5 answers

What does the .csproj file do?

Usually a C# project has a .csproj file associated with it. What is that file for? What data does it contain?
Mircea
  • 3,089
  • 6
  • 23
  • 26
73
votes
1 answer

What is NuGetPackageImportStamp for?

When adding certain NuGet packges to a project, sometimes a strange item appears in the first property group of the .csproj file. ... 3d051ef3 The stamp is…
Matt Johnson-Pint
  • 197,368
  • 66
  • 382
  • 508
1
2 3
72 73