Search code examples
.net-6.0postsharp

PostSharp Detected .NET Core SDK 7


I have a project targeting NET 6.0 framework. When I build the project, I’m getting this message

Warning Detected .NET Core SDK 7.0.100. This SDK version was not tested on this version of PostSharp. Using it may result in a build failure. Supported SDK versions are 2.1.500 to 6.0 (any revision).

Here is my project file

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

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
    <RootNamespace>$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
    <LangVersion>9.0</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
    <PackageReference Include="PostSharp.Patterns.Model" Version="6.10.16" />
    <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0">
      <TreatAsUsed>true</TreatAsUsed>
    </PackageReference>
  </ItemGroup>

</Project>

Building project in visual studio 2022


Solution

  • You can update PostSharp to version 2023.0.3. It supports .NET 7 SDK.

    The fact that your project targets .NET 6 doesn't imply that .NET 6 SDK is going to be used to build your project. By default, the highest installed SDK is used, unless you configure otherwise using global.json configuration file.