Certain user specific configurations are stored in .csproj.user. How do I tell MS Visual Studio to store this information in the .csproj every time?
Asked
Active
Viewed 7,050 times
8
-
2Why? What's the problem with having a `csproj.user` file? It allows different settings per user. – Oded Nov 29 '11 at 16:22
-
1I want all the things that Visual Studio thinks is "user specific" to be belong to the project for every one. Example is the post-build events and output directory for a dll. – mcintoda Jan 21 '12 at 00:19
2 Answers
4
I had the same problem and the only solution I could come up with was to manually edit the .csproj.user
file, cut the configuration I wanted and paste in the .csproj
file. It worked fine, despite being a somewhat user-hostile solution.

Lucio Paiva
- 19,015
- 11
- 82
- 104
2
You can't. Visual Studio stores the user-specific settings in the .csproj.user
file, and the build settings in the .csproj
file. This is to allow multiple users to work on a project, which is critical when working in a team with source control.
That being said, you can always delete the .user
file, and it will be recreated, at any point in time.

Reed Copsey
- 554,122
- 78
- 1,158
- 1,373
-
5Just to add to Reed's point: since the `.csproj.user` file is user-specific it should **not** be put under source control. – Dave M Nov 30 '11 at 03:58
-
My concern is I already have a rule to ignore *.user file, but still it is pushing the .csproj.user file to my source control? Any Idea? – OmGanesh Oct 16 '17 at 19:00
-
1@Aarush was it already added? if so, you'll have to explicitly remove it, or it keeps looking for changed versions. – Reed Copsey Oct 16 '17 at 23:07
-
Thanks @ReedCopsey It worked as suggested by you. The file should first be deleted from the remote and then the rule .user works fine (provided already defined in gitignore file) – OmGanesh Oct 19 '17 at 06:29