我通常构建到一个android仿真器,没有任何问题,直到最近的更新。现在我得到了这个错误:错误NETSDK1130 Microsoft.Graphics.Canvas.winmd不能引用。不支持在针对.NET 5或更高版本时直接引用Windows元数据组件。
我已经确保所有的nuget包裹都是最新的。据我所知,C#项目中的引用看起来很好:
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<!-- Required - WinUI does not yet have buildTransitive for everything -->
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.2" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.0.7" />
<PackageReference Include="SQLitePCLRaw.core" Version="2.0.7" />
<PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.0.7" />
</ItemGroup>其他的一切都没有改变。有人能解决这个问题吗?
发布于 2022-04-13 18:39:58
这对我有帮助:https://github.com/dotnet/maui/wiki/Migrating-to-RC1
自“迁移到预览13”以来,我完成了所有升级步骤
发布于 2022-04-13 07:38:14
首先,您指定了这些行两次,其中一行具有不同的版本号:
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.2" />第二,这看起来像一个旧的模板,也就是您已经开始了这个项目的一个较早的预览。这很好,但是对于每个更新,请仔细观察迁移项目以使用最新版本所需的内容。例如,这里是RC1的注记。特别针对这些包,它提到:
这些在您的csproj中不再需要。
https://stackoverflow.com/questions/71851304
复制相似问题