Release notes
*Sourced from [Microsoft.CodeAnalysis.FxCopAnalyzers's releases](https://github.com/dotnet/roslyn-analyzers/releases).*
> ## v2.9.5
> Release build of Roslyn-analyzers based on Microsoft.CodeAnalysis 2.9.0 NuGet packages. Works with VS 2017.9 or later.
>
> Contains following important changes on top of v2.9.4 release
>
> ### Bug Fixes
> - **Critical Performance:** Fixed memory leak in flow analysis results cache which leads to OOM exceptions and crashes on large solution. This is applicable for all rules
> - **Critical Reliability:** Hardened all the analyzers and fixers from crashes due to `Single` or `SingleOrDefault` invocations.
> - CA1065: Fixed false positives caused by breaking changes in the IOperation tree shape for throw operations.
> - CA1067: Fixed false positives.
> - CA1708: Fix high memory allocations in the rule implementation
> - CA1721: Fixed false positives.
> - CA2000: Fixed false positives
> - CA2234: Fixed false positives
> - CA2327: Do not use insecure JsonSerializerSettings -- Fixed InvalidCastException
> - CA3147: Mark verb handlers with ValidateAntiForgeryToken -- Now handles Task-based ASP.NET MVC controller action methods
> - CA3075: Insecure DTD processing in XML -- Fixed NullReferenceException.
> - CA3076: Insecure XSLT script processing -- Fixed ArgumentOutOfRangeException.
> - CA5390: Do Not Hard Code Encryption Key -- Treats Encoding.GetBytes() as a potentially hardcoded key. Also considers newer .NET Core 3.0 AesGcm and AesCcm APIs.
>
> ### Additional analyzers/fixers:
> #### Added
> - Performance
> - [CA1828](https://docs.microsoft.com/visualstudio/code-quality/ca1828): Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used -- **Enabled by default**
> - [CA1829](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/pull/2736): Use Length/Count property instead of Count() when available -- **Enabled by default**
> - Security
> - [CA2329](https://docs.microsoft.com/visualstudio/code-quality/ca2329): Do not deserialize with JsonSerializer using an insecure configuration
> - [CA2330](https://docs.microsoft.com/visualstudio/code-quality/ca2330): Ensure that JsonSerializer has a secure configuration when deserializing
> - CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers -- **Enabled by default**
> - CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes
> - CA5393: Do not use unsafe DllImportSearchPath value
> - CA5394: Do not use insecure randomness
> - CA5395: Miss HttpVerb attribute for action methods
> - CA5396: Set HttpOnly to true for HttpCookie
> - [CA5397](https://docs.microsoft.com/visualstudio/code-quality/ca5397): Do not use deprecated SslProtocols values -- **Enabled by default**
> - [CA5398](https://docs.microsoft.com/visualstudio/code-quality/ca5398): Avoid hardcoded SslProtocols values
> - CA5399: Definitely disable HttpClient certificate revocation list check
> - CA5400: Ensure HttpClient certificate revocation list check is not disabled
> - Usage
> - [CA2246](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/pull/2717): Assigning to a symbol and its member (field/property) in the same statement is not recommended. It is not clear if the member access was intended to use symbol's old value prior to the assignment or new value from the assignment in this statement. For clarity, consider splitting the assignments into separate statements -- **Enabled by default**
> - [CA2200](https://docs.microsoft.com/visualstudio/code-quality/ca2200-rethrow-to-preserve-stack-details): Code fix added
> #### Changed
> - Security
> - [CA5389](https://docs.microsoft.com/visualstudio/code-quality/ca5389): Do Not Add Archive Item's Path To The Target File System Path -- Now disabled by default
> - CA5390: Do Not Hard Code Encryption Key -- Now disabled by default
> #### New Analyzer Configuration options
> - CA1031: Add a configurable option `disallowed_symbol_names` to to allow configuration of disallowed exception types.
> - CA1062: Add configurable option `exclude_extension_method_this_parameter` for [CA1062](https://docs.microsoft.com/visualstudio/code-quality/ca1062-validate-arguments-of-public-methods) to skip analysis of extension method 'this' parameter.
> - CA1801: Respect existing option `api_surface` for CA1801 (Review unused parameters).
> - CA1802: Add configuration option `required_modifiers` for CA1802. [CA1802](https://docs.microsoft.com/visualstudio/code-quality/ca1802-use-literals-where-appropriate) only flags static readonly flags by default. This matches the legacy FxCop implementation for compat reasons. With this change, users can make the rule more aggressive by also flagging instance fields
> ... (truncated)
Changelog
*Sourced from [Microsoft.CodeAnalysis.FxCopAnalyzers's changelog](https://github.com/dotnet/roslyn-analyzers/blob/master/PostReleaseActivities.md).*
> Post-release activities
> =================================================================
>
> Please follow the below steps after publishing analyzer NuGet packages from this repo onto NuGet.org:
>
> 1. Create a new release OR Update an existing draft release:
> 1. Draft: Either click [here](https://github.com/dotnet/roslyn-analyzers/releases/new) to draft a new release OR update an [existing draft release](https://github.com/dotnet/roslyn-analyzers/releases). For reference, you can look at any of the existing releases, say [v2.9.3](https://github.com/dotnet/roslyn-analyzers/releases/edit/v2.9.3).
> 2. Release notes: Follow the steps in the *Steps to generate Release Notes* below to generate Release notes and copy the generated notes to the description section of the new release.
> 3. Publish: Mark the release as a pre-release if appropriate and click "Publish Release".
> 2. Repo changes:
> 1. Checkout a new branch from latest sources of release branch.
> 2. Update `VERSIONING.md`: Add a new row in the released version table.
> 3. Update `.github\ISSUE_TEMPLATE.md`: Update the package version in the example section to the latest released package version.
> 4. Update `eng\Versions.props`:
> 1. Bump up the `VersionPrefix`. If the new version prefix is greater then or equals the current `FlowAnalysisUtilitiesVersionPrefix`, then update `FlowAnalysisUtilitiesVersionPrefix` to `$(VersionPrefix)`.
> 2. Reset `PreReleaseVersionLabel` to `beta1`.
> 3. Update `MicrosoftCodeAnalysisFXCopAnalyersVersion` to the latest released package version.
> 5. Build the repo by invoking `eng\common\CIBuild.cmd` and fix/suppress any new CA diagnostics, as appropriate. This should also update the analyzer documentation files in the repo to use the new version prefix.
> 6. Create and submit a PR with the above changes.
>
> Steps to generate Release Notes
> =================================================================
>
> 1. Checkout the sources for the release branch locally. This would normally be the master branch.
> 2. Build.
> 3. Ensure that nuget.exe is on path.
> 4. Generate notes: Switch to the output directory, say `artifacts\bin\ReleaseNotesUtil\Debug\netcoreapp2.0` and execute `GenDiffNotes.cmd` to generate release notes. Example command line for v2.9.4 to v2.9.5: `GenDiffNotes.cmd C:\scratch nuget.org 2.9.3 2.9.4`.
Commits
- [`6c05175`](https://github.com/dotnet/roslyn-analyzers/commit/6c05175f91bf7cc463a1b71e1f6773d4afcaa7a1) Merge pull request [#2882](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2882) from mavasani/EditorConfigFiles
- [`4bc7bc6`](https://github.com/dotnet/roslyn-analyzers/commit/4bc7bc6e74a92fd19149a85735f47de59b3dc0ee) Merge pull request [#2883](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2883) from mavasani/FixNRE
- [`789704f`](https://github.com/dotnet/roslyn-analyzers/commit/789704f1241507e247b19d92ca0704f32849f8c3) Merge pull request [#2764](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2764) from dotnet/feature/catch_isymbol_equals_without_com...
- [`8570e00`](https://github.com/dotnet/roslyn-analyzers/commit/8570e006ed74f8ffc047477724430e7b9758ca50) Fix NRE in recently added AssigningSymbolAndItsMemberInSameStatement analyzer
- [`17bf198`](https://github.com/dotnet/roslyn-analyzers/commit/17bf198ca7f59cd252b1882935ea3795472a18c2) Move comments to preceding line
- [`ed00cea`](https://github.com/dotnet/roslyn-analyzers/commit/ed00ceaff0a7e0d09607fd78c32e501a4a8958f7) Unused parameters
- [`0b8763f`](https://github.com/dotnet/roslyn-analyzers/commit/0b8763f3fc99123937e1f362219b7522dd20e9f6) Do not group rules by assembly name
- [`5c76cef`](https://github.com/dotnet/roslyn-analyzers/commit/5c76cef7b2cadc455a4afa4478c2c53e3489df5d) Generate editorconfig based rule configuration files in NuGet packages
- [`acf79e6`](https://github.com/dotnet/roslyn-analyzers/commit/acf79e6cac634bdea6b602a02ffc9ae1ba6311d1) Merge pull request [#2857](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2857) from LLLXXXCCC/UseAutoValidateAntiforgeryToken
- [`188af5d`](https://github.com/dotnet/roslyn-analyzers/commit/188af5d176042555a44d1f10d4314f7e9b3c90ae) Merge pull request [#2873](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2873) from goyzhang/master
- Additional commits viewable in [compare view](https://github.com/dotnet/roslyn-analyzers/compare/v2.9.4...v2.9.5)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
Bumps Microsoft.CodeAnalysis.FxCopAnalyzers from 2.9.4 to 2.9.5.
Release notes
*Sourced from [Microsoft.CodeAnalysis.FxCopAnalyzers's releases](https://github.com/dotnet/roslyn-analyzers/releases).* > ## v2.9.5 > Release build of Roslyn-analyzers based on Microsoft.CodeAnalysis 2.9.0 NuGet packages. Works with VS 2017.9 or later. > > Contains following important changes on top of v2.9.4 release > > ### Bug Fixes > - **Critical Performance:** Fixed memory leak in flow analysis results cache which leads to OOM exceptions and crashes on large solution. This is applicable for all rules > - **Critical Reliability:** Hardened all the analyzers and fixers from crashes due to `Single` or `SingleOrDefault` invocations. > - CA1065: Fixed false positives caused by breaking changes in the IOperation tree shape for throw operations. > - CA1067: Fixed false positives. > - CA1708: Fix high memory allocations in the rule implementation > - CA1721: Fixed false positives. > - CA2000: Fixed false positives > - CA2234: Fixed false positives > - CA2327: Do not use insecure JsonSerializerSettings -- Fixed InvalidCastException > - CA3147: Mark verb handlers with ValidateAntiForgeryToken -- Now handles Task-based ASP.NET MVC controller action methods > - CA3075: Insecure DTD processing in XML -- Fixed NullReferenceException. > - CA3076: Insecure XSLT script processing -- Fixed ArgumentOutOfRangeException. > - CA5390: Do Not Hard Code Encryption Key -- Treats Encoding.GetBytes() as a potentially hardcoded key. Also considers newer .NET Core 3.0 AesGcm and AesCcm APIs. > > ### Additional analyzers/fixers: > #### Added > - Performance > - [CA1828](https://docs.microsoft.com/visualstudio/code-quality/ca1828): Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used -- **Enabled by default** > - [CA1829](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/pull/2736): Use Length/Count property instead of Count() when available -- **Enabled by default** > - Security > - [CA2329](https://docs.microsoft.com/visualstudio/code-quality/ca2329): Do not deserialize with JsonSerializer using an insecure configuration > - [CA2330](https://docs.microsoft.com/visualstudio/code-quality/ca2330): Ensure that JsonSerializer has a secure configuration when deserializing > - CA5391: Use antiforgery tokens in ASP.NET Core MVC controllers -- **Enabled by default** > - CA5392: Use DefaultDllImportSearchPaths attribute for P/Invokes > - CA5393: Do not use unsafe DllImportSearchPath value > - CA5394: Do not use insecure randomness > - CA5395: Miss HttpVerb attribute for action methods > - CA5396: Set HttpOnly to true for HttpCookie > - [CA5397](https://docs.microsoft.com/visualstudio/code-quality/ca5397): Do not use deprecated SslProtocols values -- **Enabled by default** > - [CA5398](https://docs.microsoft.com/visualstudio/code-quality/ca5398): Avoid hardcoded SslProtocols values > - CA5399: Definitely disable HttpClient certificate revocation list check > - CA5400: Ensure HttpClient certificate revocation list check is not disabled > - Usage > - [CA2246](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/pull/2717): Assigning to a symbol and its member (field/property) in the same statement is not recommended. It is not clear if the member access was intended to use symbol's old value prior to the assignment or new value from the assignment in this statement. For clarity, consider splitting the assignments into separate statements -- **Enabled by default** > - [CA2200](https://docs.microsoft.com/visualstudio/code-quality/ca2200-rethrow-to-preserve-stack-details): Code fix added > #### Changed > - Security > - [CA5389](https://docs.microsoft.com/visualstudio/code-quality/ca5389): Do Not Add Archive Item's Path To The Target File System Path -- Now disabled by default > - CA5390: Do Not Hard Code Encryption Key -- Now disabled by default > #### New Analyzer Configuration options > - CA1031: Add a configurable option `disallowed_symbol_names` to to allow configuration of disallowed exception types. > - CA1062: Add configurable option `exclude_extension_method_this_parameter` for [CA1062](https://docs.microsoft.com/visualstudio/code-quality/ca1062-validate-arguments-of-public-methods) to skip analysis of extension method 'this' parameter. > - CA1801: Respect existing option `api_surface` for CA1801 (Review unused parameters). > - CA1802: Add configuration option `required_modifiers` for CA1802. [CA1802](https://docs.microsoft.com/visualstudio/code-quality/ca1802-use-literals-where-appropriate) only flags static readonly flags by default. This matches the legacy FxCop implementation for compat reasons. With this change, users can make the rule more aggressive by also flagging instance fields > ... (truncated)Changelog
*Sourced from [Microsoft.CodeAnalysis.FxCopAnalyzers's changelog](https://github.com/dotnet/roslyn-analyzers/blob/master/PostReleaseActivities.md).* > Post-release activities > ================================================================= > > Please follow the below steps after publishing analyzer NuGet packages from this repo onto NuGet.org: > > 1. Create a new release OR Update an existing draft release: > 1. Draft: Either click [here](https://github.com/dotnet/roslyn-analyzers/releases/new) to draft a new release OR update an [existing draft release](https://github.com/dotnet/roslyn-analyzers/releases). For reference, you can look at any of the existing releases, say [v2.9.3](https://github.com/dotnet/roslyn-analyzers/releases/edit/v2.9.3). > 2. Release notes: Follow the steps in the *Steps to generate Release Notes* below to generate Release notes and copy the generated notes to the description section of the new release. > 3. Publish: Mark the release as a pre-release if appropriate and click "Publish Release". > 2. Repo changes: > 1. Checkout a new branch from latest sources of release branch. > 2. Update `VERSIONING.md`: Add a new row in the released version table. > 3. Update `.github\ISSUE_TEMPLATE.md`: Update the package version in the example section to the latest released package version. > 4. Update `eng\Versions.props`: > 1. Bump up the `VersionPrefix`. If the new version prefix is greater then or equals the current `FlowAnalysisUtilitiesVersionPrefix`, then update `FlowAnalysisUtilitiesVersionPrefix` to `$(VersionPrefix)`. > 2. Reset `PreReleaseVersionLabel` to `beta1`. > 3. Update `MicrosoftCodeAnalysisFXCopAnalyersVersion` to the latest released package version. > 5. Build the repo by invoking `eng\common\CIBuild.cmd` and fix/suppress any new CA diagnostics, as appropriate. This should also update the analyzer documentation files in the repo to use the new version prefix. > 6. Create and submit a PR with the above changes. > > Steps to generate Release Notes > ================================================================= > > 1. Checkout the sources for the release branch locally. This would normally be the master branch. > 2. Build. > 3. Ensure that nuget.exe is on path. > 4. Generate notes: Switch to the output directory, say `artifacts\bin\ReleaseNotesUtil\Debug\netcoreapp2.0` and execute `GenDiffNotes.cmd` to generate release notes. Example command line for v2.9.4 to v2.9.5: `GenDiffNotes.cmd C:\scratch nuget.org 2.9.3 2.9.4`.Commits
- [`6c05175`](https://github.com/dotnet/roslyn-analyzers/commit/6c05175f91bf7cc463a1b71e1f6773d4afcaa7a1) Merge pull request [#2882](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2882) from mavasani/EditorConfigFiles - [`4bc7bc6`](https://github.com/dotnet/roslyn-analyzers/commit/4bc7bc6e74a92fd19149a85735f47de59b3dc0ee) Merge pull request [#2883](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2883) from mavasani/FixNRE - [`789704f`](https://github.com/dotnet/roslyn-analyzers/commit/789704f1241507e247b19d92ca0704f32849f8c3) Merge pull request [#2764](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2764) from dotnet/feature/catch_isymbol_equals_without_com... - [`8570e00`](https://github.com/dotnet/roslyn-analyzers/commit/8570e006ed74f8ffc047477724430e7b9758ca50) Fix NRE in recently added AssigningSymbolAndItsMemberInSameStatement analyzer - [`17bf198`](https://github.com/dotnet/roslyn-analyzers/commit/17bf198ca7f59cd252b1882935ea3795472a18c2) Move comments to preceding line - [`ed00cea`](https://github.com/dotnet/roslyn-analyzers/commit/ed00ceaff0a7e0d09607fd78c32e501a4a8958f7) Unused parameters - [`0b8763f`](https://github.com/dotnet/roslyn-analyzers/commit/0b8763f3fc99123937e1f362219b7522dd20e9f6) Do not group rules by assembly name - [`5c76cef`](https://github.com/dotnet/roslyn-analyzers/commit/5c76cef7b2cadc455a4afa4478c2c53e3489df5d) Generate editorconfig based rule configuration files in NuGet packages - [`acf79e6`](https://github.com/dotnet/roslyn-analyzers/commit/acf79e6cac634bdea6b602a02ffc9ae1ba6311d1) Merge pull request [#2857](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2857) from LLLXXXCCC/UseAutoValidateAntiforgeryToken - [`188af5d`](https://github.com/dotnet/roslyn-analyzers/commit/188af5d176042555a44d1f10d4314f7e9b3c90ae) Merge pull request [#2873](https://github-redirect.dependabot.com/dotnet/roslyn-analyzers/issues/2873) from goyzhang/master - Additional commits viewable in [compare view](https://github.com/dotnet/roslyn-analyzers/compare/v2.9.4...v2.9.5)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot.