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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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.