Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.2.16f1
2018.3.0a1
2019.1.0a1
2019.2.0a1
Issue ID
1101950
Regression
Yes
Code Analysis Settings in Visual Studio are reset when Launching Unity
How to reproduce:
1. In the attached "case1101950" project folder open case1101950.sln in Visual Studio
2. In the Solution Explorer window right-click Solution 'case1101950' and select Properties
3. In the Properties window go to Common Properties->Code Analysis Settings
4. Change the Rule Set from "Microsoft Managed Recommended Rules" to "Microsoft All Rules" then click Apply and OK
5. Save the changes and exit Visual Studio
6. Open the project in Unity
7. In the Project window Open NewBehaviorScript in Visual Studio
8. In the Solution Explorer window right-click Solution 'case1101950' and select Properties
9. In the Properties window go to Common Properties->Code Analysis Settings
Expected result: Rule Set is set to "Microsoft All Rules"
Actual result: Rule Set is reset to "Microsoft Managed Recommended Rules"
Reproducible with: 2018.3.7f1, 2019.1.0b4, 2019.2.0a6
Not reproducible with: 2017.4.21f1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Errors are logged when importing an asset at a path with Firebase
- Entering too big of a number in 2D Renderer Lightmode Tags freezes the Editor
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
Resolution Note (2020.2.X):
The problem is with the integration of a third party tool Visual Studio. We have made Microsoft aware of the issue and their response was:
The root issue is that advanced users are customizing csproj, in this case with extra tags like <RunCodeAnalysis> or <CodeAnalysisRuleSet>.
We already re-process the solution to find external project references, but we don't have someting similar to re-process csproj files.
Now that we have Directory.Build.props and Directory.Build.targets files auto-imported by MSBuild, it should be enough to move all the user customizations in those files, instead of the generated csproj.
If you have additional questions I would suggest that you contact Microsoft.