Reputation: 2011
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
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
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