【发布时间】:2021-12-22 21:26:45
【问题描述】:
我正在将旧应用程序转换为 Azure DevOps、.NET 4.8 和新项目格式。由于一些第三方,我目前无法移动到 net5 或 6。这个项目在 x86 和 x64 中生成程序集。两个平台都完美地在本地恢复和构建,但我在 Azure DevOps 上使用 x64 时遇到了故障。
##[error]C:\Program Files\dotnet\sdk\5.0.404\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1047: Assets file 'D:\a\1\s\src\BraccoUIComponents\obj\project.assets.json' doesn't have a target for 'net48/win7-x64'. Ensure that restore has run and that you have included 'net48' in the TargetFrameworks for your project. You may also need to include 'win7-x64' in your project's RuntimeIdentifiers.
我在Directory.Build.props 中有以下几行:
<TargetFramework>net48</TargetFramework>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
<Platforms>x64;x86</Platforms>
我已经测试了https://github.com/dotnet/sdk/issues/1321 中列出的各种解决方案以及各种 SO 线程,但它们似乎都不起作用(TargetFrameworks、RuntimeIdentifier、RuntimeIdentifiers、win-x64、win7-x64...) .
【问题讨论】:
标签: c# .net azure-pipelines