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

1.4k views Asked by At

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.

2

There are 2 answers

0
PMF On

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.

0
Kirsten On

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.