Skip to content
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

Properties\GlobalSuppressions.cs not recognized; new "GlobalSuppressions.cs" file is generated in the project root #76793

Open
siegfriedpammer opened this issue Jan 17, 2025 · 1 comment
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@siegfriedpammer
Copy link
Contributor

Version Used:

Microsoft Visual Studio Professional 2022 (2) (64-bit) - Current
Version 17.12.3

Coming from https://developercommunity.visualstudio.com/content/problem/937290/new-globalsuppressionscs-file-is-generated-when-th.html and #42201 (which was closed and locked due to missing feedback), and #37530, which seems to be fixed. I just now experienced this... @CyrusNajmabadi what kind of feedback do you need?

The existing file is included explicitly in the project via:

    <Compile Include="Properties\GlobalSuppressions.cs" />

Its content is:

// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project. Project-level
// suppressions either have no target or are given a specific target
// and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click "In Project
// Suppression File". You do not need to add suppressions to this
// file manually.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]

this I tried:

  • changing the file header comment to match the one in the newly generated file; didn't help
  • inserting a using System.Diagnostics.CodeAnalysis; at the start, just like the newly generated file would contain; didn't help either...
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 17, 2025
@siegfriedpammer
Copy link
Contributor Author

Note: the project I am working with is super old legacy code, which previously used FxCop and the suppression file seems to be from that era.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant