asp.net - 为 ASP.NET 项目设置 CircleCI
问题描述
我正在使用 CircleCI 为我的 ASP.NET 项目设置 CI/CD 管道。
CircleCI 已经支持 Window Machine。所以我认为可以将 CircleCI 用于 ASP.NET 项目。通过遵循 CircleCI 的文档,我可以配置.NET Core
项目(因为我可以使用命令行来构建和运行exe
.NET Core 项目的文件)
version: 2.1
orbs:
win: circleci/windows@1.0.0
jobs:
build:
executor:
name: win/vs2019
shell: powershell.exe
steps:
- checkout
- restore_cache:
keys:
- dotnet-packages-v1-{{ checksum "circleci-demo-windows.csproj" }}
- run:
name: "Install project dependencies"
command: dotnet.exe restore
- save_cache:
paths:
- C:\Users\circleci\.nuget\packages
key: dotnet-packages-v1-{{ checksum "circleci-demo-windows.csproj" }}
- run:
name: "Run Build step"
command: dotnet.exe publish -c Release -r win10-x64
- run:
name: "Test the executable"
command: .\bin\Release\netcoreapp2.1\win10-x64\publish\circleci-demo-windows.exe
- store_artifacts:
path: .\bin\Release\netcoreapp2.1\win10-x64\publish\circleci-demo-windows.exe
但似乎我不能使用dotnet.exe publish...
.NET 框架等命令。那么如何为 ASP.NET 设置 CircleCi 呢?
对不起我的天真问题,我四处搜索但找不到任何关于 CircleCI 和 .net 框架的教程。
解决方案
(dotnet.exe
或可以简称为dotnet
)命令对 .NET Core 相关项目有效。它根本不能用于 .NET Framework 项目。
如果要发布 .NET Framework 项目,则应使用或运行 MSBUILD 而不是 run dotnet
。CircleCI 文档在某种程度上并不完整,因为它给您的印象是您可以使用它dotnet
来发布 .NET Framework 项目,但实际上不能。
推荐阅读
- php - PDF 不使用 artkonekt 下载
- asp.net - 无法将“WhereEnumerableIterator`1[Object]”类型的对象转换为“System.Linq.IQueryable`1[Object]”类型
- node.js - passport.authentication 需要一个回调函数
- mysql - MySQL合并两个具有相似数据联合/连接的表?
- linux - tcpdump 通过 grep 管道写入文件。(奇怪的数字 16)
- ruby - ruby assert_equal 未定义方法'downcase' 0..13:Range
- php - 在 SQL 中多次选择一个值
- java - Java 的 hashSet 处理具有相同哈希码的多个项目
- ada - Ada.Text_IO.Float_IO.get() 未按预期运行
- machine-learning - 我们如何定义神经网络中的不良学习率?