关于 .net:dotnet restore: 排除项目

dotnet restore: exclude project

我有一个 project solution,我也有一个 wix 项目。实际上 dotnet 不支持 wix。在我的构建管道上,我必须为下一个 stage.

运行 dotnet restore

但是因为wix项目,我总是得到以下错误:

D:\GitlabRunnerService\builds\fc40b836\0\customers\foo\foo-zls\src\foo.zls.setup.common\foo.zls.setup.common.wixproj(34,5): error : The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/

有什么办法可以从dotnet restore命令中排除项目吗?

gitlab-ci.yml

1
2
3
4
5
6
7
8
9
10
11
12
test:Common:
    stage: test
    script:
        - dotnet restore src
        - dotnet test --no-build -c Release -v n src\$env:TESTPROJECT\$env:TESTPROJECT.csproj --logger"trx;LogFileName=testreport.trx"
    after_script:
        - trx2junit src\$env:TESTPROJECT\Testresults\testreport.trx
    artifacts:
        reports:
            junit: src\$env:TESTPROJECT\Testresults\testreport.xml
    tags:
        - dotnet-ps

在 Release 配置中,wix 项目已经被排除在外。

相关讨论

  • 您是否尝试从内置解决方案属性中跳过此项目?
  • 在解决方案视图中右键单击项目 => 卸载项目 => 构建?
  • 我添加了更多信息

我只恢复特定项目,而不是恢复完整的解决方案。因此,将恢复命令更改为 dotnet restore src\$env:TESTPROJECT\$env:TESTPROJECT.csproj 后,一切都按预期工作!`

离题:

我需要 dotnet restore 命令来查找 buid 管道中的所有 nunit tests..

'dotnet test' 未在 gitlab-runner 管道中找到 nunit 测试


大家好,我也面临同样的问题,但我设法解决了。比较项目依赖文件夹名称大小写后发现,在.net核心中获取项目引用时,路径中的某些字符变为大写,如下所示。

XX.XXXXX.Aws.XX - 正确一个
XX.XXXXX.AWS.XX - 自动转换且无法读取


以上是关于 .net:dotnet restore: 排除项目的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>