1

There are some compiler warnings that are caused either by the legacy code or metadata from Microsoft or cannot be resolved. These warnings make it harder to notice actual compiler warnings. How can compiler warnings be supressed so they do not appear in the compiler results?

E.g. a commonly seen compiler warning is the following:

Warning
Assembly 'Microsoft.Xbox.Experimentation.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d91bba2b903dc20f' failed to load because it was not found.
C:\AOSService\PackagesLocalDirectory\ApplicationCommon\ApplicationCommon\AxReference\Microsoft.Commerce.Flighting.Common.xml

FH-Inway
  • 4,432
  • 1
  • 20
  • 37

1 Answers1

2

Compiler warnings can be suppressed using the same technique that is used to suppress best practice deviations (see for example Suppress Best-Practice Deviations).

To do so, you need to add entries to the Best Practice Suppressions xml. The entries can be found in the BuildModelResult.xml or BuildProjectResult.xml files in the Metadata folder of the package in the PackagesLocalDirectory. The following entry will suppress the compiler warning from the question. Make sure to replace the text in the <Justification /> tag with something that is meaningful to you.

<Diagnostic>
  <DiagnosticType>ExternalReference</DiagnosticType>
  <Severity>Warning</Severity>
  <Path>dynamics://Reference/Microsoft.Commerce.Flighting.Common</Path>
  <Moniker>AssemblyFileNotFound</Moniker>
  <Justification>Legacy issue</Justification>
</Diagnostic>
FH-Inway
  • 4,432
  • 1
  • 20
  • 37