- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用首先安装 .Net Core SDK (2.2) 的任务组为 Azure DevOps 中的 AspNet Core Web Api 创建构建管道,然后使用 dotnet restore
进行包还原(使用 VSTS 提要),然后构建项目。
在构建步骤,我提供以下参数:--configuration Release --runtime $(Target Platform) --no-restore /p:Version=$(Major Version).$(Minor Version).$(Build.BuildNumber)
.
到build
的所有步骤步骤成功。但是,我在构建步骤中收到以下错误:
[command]C:\windows\system32\chcp.com 65001
Active code page: 65001
[command]C:\hostedtoolcache\windows\dotnet\dotnet.exe build D:\a\1\s\WebApp\WebApp.csproj --configuration Release --runtime linux-x64 --no-restore /p:Version=1.0.40
Microsoft (R) Build Engine version 16.2.32702+c4012a063 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
C:\hostedtoolcache\windows\dotnet\sdk\2.2.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file 'D:\a\1\s\WebApp\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/linux-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'linux-x64' in your project's RuntimeIdentifiers. [D:\a\1\s\WebApp\WebApp.csproj]
Build FAILED.
C:\hostedtoolcache\windows\dotnet\sdk\2.2.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1047: Assets file 'D:\a\1\s\WebApp\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/linux-x64'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. You may also need to include 'linux-x64' in your project's RuntimeIdentifiers. [D:\a\1\s\WebApp\WebApp.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.53
##[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1
##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\WebApp\WebApp.csproj
##[section]Finishing: Build
最佳答案
要解决此问题,请尝试删除 --no-restore
.
要解释为什么在本地没有问题,那是因为当您在本地构建项目时,它使用的是以前版本的 物镜如果当前文件不满足编译条件,则缓存中存在的文件。您可以尝试删除 垃圾箱和 物镜本地文件,然后再次运行这些命令。您还将看到相同的错误。这是我在本地遇到的错误,通过删除 --no-restore
解决了.
默认情况下,如果您没有指定 --runtime linux-x64
,它恢复的包的 RID 是 win-x64
.您只能通过运行 进行测试dotnet 恢复 使用自托管代理在 Azure Devops 中执行任务,并检查 project.assets.json 文件:
你会看到,如果没有指定,它恢复的包的默认 RID 是 win-x64
.同 dotnet 构建 任务,自 从 .NET Core 2.0 SDK 开始,dotnet restore 在您运行 dotnet build 时隐式运行 :
这时候,如果你指定了--no-restore
在 dotnet build
,默认情况下,它将使用由任务“dotnet restore”恢复的包,其 RID 为 win-x64
. 但是在您的构建任务中,您指定了 runtime
构建为 linux-x64
.这与包裹不符。这就是您收到消息的原因:error NETSDK1047: Assets file 'D:\a\1\s\WebApp\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2/linux-x64'.
直接删除--no-restore
然后再试一次
错误信息应该消失了。
关于azure-devops - Azure DevOps : Assets file doesn't have a target for '.NETCoreApp,Version=v2.2/linux-x64' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57754052/
我有一个 div,我希望使用 css 显示为 :target。到目前为止,这工作正常。我的问题是:我希望它淡入淡出。 我的代码: Content #stuff { opacity:0;
我想找到在Rust构建中使用的libc.so文件,以便我可以使用--version进行查询。 (一些libcs通过C宏公开其版本信息,因此,它们的另一种选择是在构建脚本中使用cc条板箱。但其他诸如
我仍然不明白为什么 Makefile 中的“虚假”规则将“.PHONY”作为其目标。作为先决条件,这会更合乎逻辑。 我需要详细说明这一点吗?如果A依赖于B并且B是假的,那么A也是假的。因此,与 .PH
在 Fortran 语言中,向具有 TARGET 属性的虚拟参数的过程提供不具有 TARGET 属性的参数应该会导致无效代码。但是,当使用 gfortran (5.1.0) 或 ifort (14.0
如果有人发布过相同的问题,请原谅我,我找不到类似问题的答案。 当我单击带有 #dotNetComponents url 的按钮时,它会将我带到带有 dotNetComponents ID 的 div,
我想用 :target 伪类更改我的 html 中元素的样式。我的标记(第一个是按钮,第二个是目标元素): Call to action target CSS: #btn01:target { b
下面提到的示例代码是 Keith Wood 的 jQuery Countdown 插件的一部分。有人能解释一下吗 _attachCountdown: function(target, options)
我是 React 的新手。这绝对让我感到困惑。我可以使用 event.target 访问 HTML 元素,它显示的值等于某个数字,但每次我使用 event.target.value 时,我都会得到 u
这个问题是关于交叉编译的。 使用 swift 编译器的 -target 或 -target-cpu 选项可以使用哪些不同的目标?我在哪里可以找到概述? 它只能用于创建 iOS/watchOS 应用程序
在CKEditor 5中,我没有在链接对话框中看到目标属性的字段。 如何添加这样的字段?或将target = _blank设置为默认值。 谢谢 最佳答案 从Link Plugin的11.1.0版本开始
问题:FAKE 中是否有一个命令可以打印构建脚本中所有定义的目标? 我想以这样的方式设置我的 FAKE 构建:当我不指定目标时,它会打印构建脚本中所有可用目标的列表。 例如: > build.cmd
尝试使用 Visual Studio 2013 Update 3 创建一个新的 Cordova“空白应用程序”。 我看到了模板,但是当尝试打开空白应用程序时,我得到: The imported pro
http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html 此元注释指示声明的类型仅用作复杂注释类型声明
使用CocoaPods,有什么区别 target :TargetName do # Some pods... end 和 target "TargetName" do #
我正在尝试仅使用 CSS 制作一个简单的移动菜单切换。通过显示和隐藏两个按钮,这些按钮具有指向显示或隐藏导航菜单的类的不同链接。 是本教程的编辑link ,但现在我想让关闭和打开按钮位于单独的 div
以下是包含简单日志文件目标的简单 nlog 配置。我的问题是如何为 Nlog.Targets.Redis 添加目标? 最佳答案 以下是 NLog.Targets.Redis 的正确配置。如果
我想知道您是否可以将一个单元测试包链接到多个目标。因此,可以使用一个测试包测试所有应用程序目标。 我在所有应用程序目标之间有一些共享代码,但也有一些基于正在运行的应用程序目标的特定计算。 目前,如果我
我在 VSTS 中使用部署组将我的应用程序部署到本地测试 Web 服务器。 它已经运行良好很长时间了,但是在大约 6 周没有使用它之后,我现在遇到了这个错误,我想修复它; 最佳答案 您的代理未运行或无
使用 CMake 构建开源项目时(在我的例子中,它是柠檬图库),当我尝试通过 -DBUILD_SHARED_LIBS=1 构建共享库时出现此错误。 : TARGETS given no LIBRARY
尝试安装 ionic,添加 android 平台时出现以下错误 Error: Please install Android target "android-19". Hint: Run "androi
我是一名优秀的程序员,十分优秀!