gpt4 book ai didi

c# - Azure 管道失败并显示警告 MSB3246 : Resolved file has a bad image

转载 作者:行者123 更新时间:2023-12-02 08:22:35 25 4
gpt4 key购买 nike

我无法使用 Azure 在 .Net 5.0 中构建引用简单 DLL 的解决方案,该解决方案在使用 VS2019 的 x64 计算机上的任何 CPU/版本中构建。当它尝试加载 DLL 时,Azure 会提示:

Warning MSB3246: Resolved file has a bad image, no metadata, or isotherwise inaccessible. Could not load file or assembly 'xxx.dll' orone of its dependencies. An attempt was made to load a program with anincorrect format

该项目在本地运行良好,两个项目(构建DLL和Azure必须构建的项目)都在.Net 5.0中,默认的“任何CPU”配置,没有什么特别的。我想将其保留在“任何 CPU”中,而不必像在开发计算机上那样定义任何自定义构建平台/配置。

这是 yaml 管道文件的(稍微简化的)开头:

trigger:- develop

pool: vmImage: 'windows-latest'

variables: solution: './Projects/**/*.sln' buildPlatform: 'AnyCPU' buildConfiguration: 'Release'

steps:

  • task: NuGetToolInstaller@1

  • task: NuGetCommand@2 inputs:restoreSolution: '$(solution)'

  • task: VSBuild@1 inputs:solution: '$(solution)'platform: '$(buildPlatform)'configuration: '$(buildConfiguration)'

是否有一个特定的参数可以提供给 Azure,使其与简单的已构建的“任何 CPU”DLL 一起工作?

最佳答案

在 YAML 构建中,添加 a checkout step with lfs set to true :

steps:
- checkout: self
lfs: true

如果没有它,文件将被替换为 lfs 下载位置的占位符。

这是ticket可以引用一下。

关于c# - Azure 管道失败并显示警告 MSB3246 : Resolved file has a bad image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67233003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com