Conversation
- Option 1: Reduce severity from Error to Warning - Option 2: Change 'will fail' to 'may fail' in diagnostic message - Option 3: Add vs-mef.ContractNamesAssignability.txt AdditionalFiles support Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix false positives for VSMEF008 in VS SDK contexts
Reduce VSMEF008 false positives: lower severity, soften wording, add allow-list support
Feb 25, 2026
AArnott
approved these changes
Feb 25, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
AArnott
reviewed
Feb 25, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
javierdlg
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VSMEF008 was too aggressive for VS SDK contexts where using a type identity as a contract name (e.g.
SVsFullAccessServiceBroker→IServiceBroker) is a legitimate and common pattern, causing falseError-level diagnostics.Changes
Error→Warning): The static analysis cannot guarantee failure; it can only flag a potential issue.AdditionalFiles: SDKs can register known-good type-identity-as-contract-name pairs to suppress the diagnostic for specific assignments.Allow-list format
Add a file named
vs-mef.ContractNamesAssignability.txtas anAdditionalFilesentry in your project:Each line uses the pattern
MemberType <= ContractType(fully qualified names):Blank lines and lines starting with
#are ignored.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
h8evsblobprodwus2120.vsblob.vsassets.io/opt/hostedtoolcache/dotnet/dotnet /opt/hostedtoolcache/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.deps.json /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/testhost.dll --port 45297 --endpoint 127.0.0.1:045297 --role client --parentprocessid 5433 --telemetryoptedin false(dns block)/opt/hostedtoolcache/dotnet/dotnet /opt/hostedtoolcache/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.deps.json /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/testhost.dll --port 34139 --endpoint 127.0.0.1:034139 --role client --parentprocessid 12784 --telemetryoptedin false(dns block)/opt/hostedtoolcache/dotnet/dotnet /opt/hostedtoolcache/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.deps.json /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/testhost.dll --port 43695 --endpoint 127.0.0.1:043695 --role client --parentprocessid 20365 --telemetryoptedin false(dns block)xofvsblobprodwus2114.vsblob.vsassets.io/opt/hostedtoolcache/dotnet/dotnet dotnet build /home/REDACTED/work/vs-mef/vs-mef/src/Microsoft.VisualStudio.Composition.Analyzers/Microsoft.VisualStudio.Composition.Analyzers.csproj -c Release --no-restore(dns block)/opt/hostedtoolcache/dotnet/dotnet dotnet build test/Microsoft.VisualStudio.Composition.Analyzers.Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests.csproj -c Release(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.