admin管理员组

文章数量:1406942

<PropertyGroup>
  <TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
  <OutputType>Exe</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net48'">
  <RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
</PropertyGroup>

After running dotnet restore I see win-x86 in project.assets.json while I would expect only win7-.. targets.

"targets": {
  ".NETFramework,Version=v4.8": {},
  ".NETFramework,Version=v4.8/win-x86": {},
  ".NETFramework,Version=v4.8/win7-x64": {},
  ".NETFramework,Version=v4.8/win7-x86": {},
  "net8.0-windows7.0": {},
  "net8.0-windows7.0/win-x86": {},
  "net8.0-windows7.0/win7-x64": {},
  "net8.0-windows7.0/win7-x86": {}
},

And then on build I'm getting

error NETSDK1047: Assets file '...\obj\project.assets.json' doesn't have a target for 'net48/win-x86'.

How to solve this error?

本文标签: netUnexpected targets in projectassetsjsonStack Overflow