gib65
gib65

Reputation: 2011

How do I force Visual Studio 2019 to produce .csproj.user file?

I am developing a C# project in Visual Studio 2019. I've read that it should produce .csproj.user files automatically, but it is not. How do I force Visual Studio to produce a .csproj.user file? Thank you.

Upvotes: 2

Views: 1970

Answers (2)

Kirsten
Kirsten

Reputation: 18170

In my case strangely some references that should have been in the SDK project had found their way into the csproj.user file. I don't know why this happened. Once I put the references back in the SDK project I had no need for the csproj.user after all.

Upvotes: 0

PMF
PMF

Reputation: 17288

As mentioned by Hans Passant above, this file is created when there exist user-specific settings. Typically it is created by changing any of the Project->Properties->Debug settings to non-default values (i.e. specifying command line arguments or setting an absolute path for the working directory).

However, as I already have pointed out in the other question, I believe you should not commit this file and find out why you have problems without it. Or rather, why VS adds some relevant information to this file instead of the main csproj.

Upvotes: 1

Related Questions