最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Why does a warning icon appear over an installed nuget package icon? - Stack Overflow

programmeradmin1浏览0评论

As you can see, the MCData package has a warning icon. The project MCSecure compiles fine for both net48 and net8.0-windows. So I checked the Messages output and the only issue I can relate to a possible cause for the icon is:

Package 'MCData 25.1.30' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0-windows7.0'. This package may not be fully compatible with your project.

The MCData nuspec file quotes the TargetFrameWork as follows:

target="lib\net8.0-windows10.1\MCData.v25.1.30.dll"

I don't believe you can add a target framework version number in the MCSecure.csproj file so how does the complier come up with a Windows verion of 7.0 as causing the issue.

The above may or may not be the cause for the warning icon but I think it's a fair bet that it is.

As you can see, the MCData package has a warning icon. The project MCSecure compiles fine for both net48 and net8.0-windows. So I checked the Messages output and the only issue I can relate to a possible cause for the icon is:

Package 'MCData 25.1.30' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0-windows7.0'. This package may not be fully compatible with your project.

The MCData nuspec file quotes the TargetFrameWork as follows:

target="lib\net8.0-windows10.1\MCData.v25.1.30.dll"

I don't believe you can add a target framework version number in the MCSecure.csproj file so how does the complier come up with a Windows verion of 7.0 as causing the issue.

The above may or may not be the cause for the warning icon but I think it's a fair bet that it is.

Share Improve this question asked Jan 30 at 4:59 DavidDavid 1,0582 gold badges13 silver badges31 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

Not only can you include target framework values in the .csproj file, if you don't you get the warning described above. Adding the version number removed the warning and the icon...

  <TargetFrameworks>net48;net8.0-windows10.0.17763</TargetFrameworks>

If your project simply targets net8.0-windows, it may default to windows7.0 (the minimum supported version in .NET 8.0), causing the mismatch.

Modify MCSecure.csproj to add the full targetframework.

<TargetFramework>net8.0-windows10.1</TargetFramework>
发布评论

评论列表(0)

  1. 暂无评论