# VS IDE Suppress Compiler Warnings Project Wide

There are some cases where it is necessary to suppress IDE compiler warnings that apply to the entire project.

This can be warnings that occur several times across the source files.

Or, it can be for a compiler warning that the project’s framework target is out of support.

This latter case is currently a problem for any VS solution that is maintaining older framework targets, such as for NET5.0 which is out of support (as of 2022, I think).

Anyway. To suppress a compiler warning for an unsupported framework target, or to suppress many occurrences of the same error, edit your project file by adding a NoWarn entry to the PropertyGroup that lists the Target Framework.

For example, the following project file fragment suppresses compiler warnings for NET5 being out of support:

```xml
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <!-- NoWarn below suppresses NETSDK1138 project-wide -->
    <!-- This suppresses the IDE warning that NET5.0 is out of support. -->
    <NoWarn>$(NoWarn);NETSDK1138</NoWarn>

    ...

  <PropertyGroup>

...
</Project>
```

In the above example, the NoWarn entry suppresses compiler warning “`NETSDK1138`“, project-wide.

See this reference for some warnings for obsolete features of NET5: <span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/obsoletions-overview" data-inline-card="true" data-renderer-start-pos="1277"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper" role="button">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">Obsolete features in .NET 5+ - .NET</span></span>](https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/obsoletions-overview)</span></span></span>

See this reference for the specific compiler warning that Net5 is out of support: <span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1138?f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(NETSDK1138)%26rd%3Dtrue" data-inline-card="true" data-renderer-start-pos="1363"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper" role="button">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">NETSDK1138: The target framework is out of support - .NET CLI</span></span>](https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1138?f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(NETSDK1138)%26rd%3Dtrue)</span></span></span>