为ASP.NET项目设置CircleCI

问题描述 投票:0回答:1

我正在使用CircleCI为我的ASP.NET项目设置CI / CD管道。

CircleCI已经支持Window Machine。因此,我认为可以将CircleCI用于ASP.NET项目。通过遵循CircleCI的documentation,我可以为.NET Core项目进行配置(因为我可以使用命令行来构建和运行.NET Core项目的exe文件)

version: 2.1

orbs:
  win: circleci/[email protected]

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

但是似乎我无法对.NET Framework使用诸如dotnet.exe publish...之类的命令。那么如何为ASP.NET设置CircleCi?

很抱歉,我的幼稚问题我已经四处搜寻,但找不到关于CircleCI和.net框架的任何教程。

asp.net .net continuous-integration circleci
1个回答
0
投票

dotnet.exe(或可以简称为dotnet)命令对.NET Core相关项目有效。它根本不能用于.NET Framework项目。

如果要发布.NET Framework项目,则应使用或运行MSBUILD而不是运行dotnet。 CircleCI文档尚不完整,因为它给您的印象是您可以使用dotnet发布.NET Framework项目,但实际上却不能。

© www.soinside.com 2019 - 2024. All rights reserved.