Questions tagged [csproj]

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

1301 questions
39
votes
1 answer

What is usevshostingprocess in *.csproj?

Today, all of a sudden I found this in my *.csproj file < UseVSHostingProcess> False When i Compared it with latest it was added into I have alot search on Google and…
raholsn
  • 658
  • 1
  • 7
  • 15
39
votes
2 answers

How to make notepad++ treat csproj files as XML automatically?

I often use notepad++ for editing of the csproj files. And I always need to go to the Language menu and select XML in order to get syntax highlighting. Is it possible to configure notepad++ to treat csproj files as XML automatically?
mark
  • 59,016
  • 79
  • 296
  • 580
37
votes
6 answers

How to upgrade csproj files with VS2017

VS2017 has so far correctly converted several project.json/.xproj based projects to the new .csproj format. I would also like to use the new .csproj format with older .csproj projects that previously targeted only .NET Framework (i.e. they didn't…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
36
votes
1 answer

Add a msbuild task that runs after building a .NET Core project in Visual Studio 2017 RC

Is there something like the AfterBuild Target in msbuild with .NET Core in Visual Studio 2017 RC? I tried to add the following snipped to the .csproj file, but it is not excuted during a build (Contrary to VS2015 where it does work).
Fionn
  • 10,975
  • 11
  • 54
  • 84
35
votes
4 answers

What is server garbage collection in ASP.NET Core?

I've upgraded a ASP.NET Core project to VS2017 and the new csproj, and there is this option: true What is server garbage collection? There is no proper…
grokky
  • 8,537
  • 20
  • 62
  • 96
34
votes
2 answers

What is the difference between "none include" and "none update" in SDK-style csproj projects?

I was looking for the correct way to ensure appsettings.json is copied to the bin directory when building my project. This article recommends using "none update"
user453441
  • 1,026
  • 2
  • 13
  • 26
34
votes
1 answer

Where is full documentation about the csproj format for .net core?

Is there a full documentation about the csproj format for .net core projects? I was looking for a way to copy files before building. After some searching I found a solution, but I can't find the documentation for this. Does it overwrite files? Are…
roeland
  • 6,058
  • 7
  • 50
  • 67
34
votes
6 answers

MvcBuildViews true with Entity Framework in ASP.NET MVC 2

In VS 2010, changing true in a MVC2 project's .csproj file causes an error if you are using Entity Framework. Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'. …
Alper
  • 1,393
  • 13
  • 16
33
votes
1 answer

A full explanation for the ResolvedFileToPublish XML element?

By default, the ASP.NET Core SPA project templates have a section in their .csproj files like so:
Jez
  • 27,951
  • 32
  • 136
  • 233
32
votes
6 answers

How to make Sonarqube exclude a .NET (C#) project from coverage measures

Sonarqube allows for individual files to be excluded from code coverage by adding patterns in the sonar.coverage.exclusions key. This can be done on a project level by adding them in the UI and even in a .csproj file by specifying a SonarQubeSetting…
mvandevy
  • 421
  • 1
  • 5
  • 4
30
votes
1 answer

How do I use ASP.NET Core 3.0 types from a library project for shared Controllers, Middleware etc?

While ASP.NET Core up to 2.2 could be consumed through NuGet to create library projects for shared Controllers, Middleware etc, how do I create a library that is able to use ASP.NET Core 3.0 types? While for projects containing views there is a…
Martin Ullrich
  • 94,744
  • 25
  • 252
  • 217
30
votes
4 answers

csproj copy files depending on operating system

I am using .NET Core to build a cross platform class library. Depending on the operating system that the C# .NET Core project is built for using a .csproj file, I need to copy a native library to the project's output directory. E.g., for OS X I want…
sakra
  • 62,199
  • 16
  • 168
  • 151
29
votes
2 answers

Sorted order of files in .csproj

In a Visual Studio csproj, the files to compile are referenced like this: It seems to me…
Wilbert
  • 7,251
  • 6
  • 51
  • 91
29
votes
3 answers

Reading the list of References from csproj files

Does anyone know of a way to programmatically read the list of References in a VS2008 csproj file? MSBuild does not appear to support this functionality. I'm trying to read the nodes by loading the csproj file into an XmlDocument but, the XPath…
user146059
28
votes
9 answers

Failed to compute cache key: ".csproj" not found

I am new to Docker. I created a Web API using ASP.Net Core using Visual Studio 2019 as well as in VS Code. It works fine. Then I added docker support and added Dockerfile with default values. When I try to build the docker image, it fails in Visual…
1 2
3
86 87