-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: MSBuild switch for turning on/off analysis #23591
Comments
Note that as a workaround, you can enable such functionality using a simple MSBuild target: roslyn/eng/targets/Imports.targets Lines 134 to 143 in 90bdf25
|
This page currently includes a new Roslyn Analyzers section with the following controls: 1. Hyperlinks for overview documentation on Roslyn analyzers and FxCopAnalyzers with install guidance 2. Check boxes to selectively disable analyzer execution during build and/or live analysis via project properties `RunRoslynAnalyzersDuringBuild` and `RunRoslynAnalyzersDuringLiveAnalysis`. Default values are 'true' for both of these. Addresses dotnet/roslyn#23591 3. Text box showing the installed FxCopAnalyzers NuGet package version, if any. 4. Following buttons: 1. Install Latest: Installs the latest stable FxCopAnalyzers NuGet package. 2. Install Custom: Opens NuGet package manager with "Microsoft.CodeAnalysis.FxCopAnalyzers" as the search string for custom installation. 3. Uninstall: Uninstalls the currently installed FxCopAnalyzers NuGet package. 4. Refresh: Refreshes the UI, in case user has done offline install/uninstall/upgrade of NuGet packages. https://devdiv-design.visualstudio.com/D3%20Studio/_workitems/edit/7294 has the complete workflow with screenshots for the UI changes. Addresses part of dotnet#266
@mavasani We're having the same problem, where do we find roslyn/eng/targets/Imports.targets file? |
@lgawel-cayan I meant you should create/change your targets file to copy that target so it runs for your project. You can also create a custom Directory.Build.targets: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#directorybuildprops-and-directorybuildtargets and add this target to it. |
This page currently includes a new Roslyn Analyzers section with the following controls: 1. Hyperlinks for overview documentation on Roslyn analyzers and FxCopAnalyzers with install guidance 2. Check boxes to selectively disable analyzer execution during build and/or live analysis via project properties `RunRoslynAnalyzersDuringBuild` and `RunRoslynAnalyzersDuringLiveAnalysis`. Default values are 'true' for both of these. Addresses dotnet/roslyn#23591 3. Text box showing the installed FxCopAnalyzers NuGet package version, if any. 4. Following buttons: 1. Install Latest: Installs the latest stable FxCopAnalyzers NuGet package. 2. Install Custom: Opens NuGet package manager with "Microsoft.CodeAnalysis.FxCopAnalyzers" as the search string for custom installation. 3. Uninstall: Uninstalls the currently installed FxCopAnalyzers NuGet package. 4. Refresh: Refreshes the UI, in case user has done offline install/uninstall/upgrade of NuGet packages. https://devdiv-design.visualstudio.com/D3%20Studio/_workitems/edit/7294 has the complete workflow with screenshots for the UI changes. Addresses part of dotnet#266
This page includes a new Roslyn Analyzers section with the following controls: 1. Hyperlink for overview documentation on Roslyn analyzers 2. Check boxes to selectively disable analyzer execution during build and/or live analysis via project properties `RunRoslynAnalyzersDuringBuild` and `RunRoslynAnalyzersDuringLiveAnalysis`. Default values are 'true' for both of these. Addresses dotnet/roslyn#23591. These properties will be respected once the targets change in https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/190487 makes it in. 3. Text box showing the installed FxCopAnalyzers NuGet package version, if any. 4. Following buttons: 1. Install: Installs the known latest stable FxCopAnalyzers NuGet package (currently 2.9.3) 2. Browse ('...'): Opens NuGet package manager with "Microsoft.CodeAnalysis.FxCopAnalyzers" as the search string for custom installation. 3. Uninstall: Uninstalls the currently installed FxCopAnalyzers NuGet package. 4. Refresh: Refreshes the UI, in case user has done offline install/uninstall/upgrade of NuGet packages. https://devdiv-design.visualstudio.com/D3%20Studio/_workitems/edit/7294 has the complete workflow with screenshots for the UI changes. Addresses part of dotnet#266
* Add Code Analysis property page This page includes a new Roslyn Analyzers section with the following controls: 1. Hyperlink for overview documentation on Roslyn analyzers 2. Check boxes to selectively disable analyzer execution during build and/or live analysis via project properties `RunRoslynAnalyzersDuringBuild` and `RunRoslynAnalyzersDuringLiveAnalysis`. Default values are 'true' for both of these. Addresses dotnet/roslyn#23591. These properties will be respected once the targets change in https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/190487 makes it in. 3. Text box showing the installed FxCopAnalyzers NuGet package version, if any. 4. Following buttons: 1. Install: Installs the known latest stable FxCopAnalyzers NuGet package (currently 2.9.3) 2. Browse ('...'): Opens NuGet package manager with "Microsoft.CodeAnalysis.FxCopAnalyzers" as the search string for custom installation. 3. Uninstall: Uninstalls the currently installed FxCopAnalyzers NuGet package. 4. Refresh: Refreshes the UI, in case user has done offline install/uninstall/upgrade of NuGet packages. https://devdiv-design.visualstudio.com/D3%20Studio/_workitems/edit/7294 has the complete workflow with screenshots for the UI changes. Addresses part of #266 * Address feedback * Remove the "Restore" button and instead enable auto-restore during property page activation. We only force restore packages now when user explicitly clicks Install/Uninstall button on the UI * Avoid using the code name "Roslyn" in the property page and MSBuild properties.
It would be very handy to have an MSBuild property that switches on/off Roslyn code analysis, so you could so something like:
This would work in a similar way to the old
RunCodeAnalysis
MSBuild property for pre-Roslyn code analysis.The text was updated successfully, but these errors were encountered: