首页 > 解决方案 > Azure Pipeline 和 .NET Framework 项目

问题描述

当我们尝试部署 .NET Framework 应用程序时,我们遇到了以下问题(使用链接项目):

##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\Microsoft.Common.CurrentVersion.targets(781,5): Warning : The OutputPath property is not set for project 'Efs.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Release'  Platform='Any CPU'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

我的 .csproj 文件具有以下内容:

  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
    <AzureFunctionsVersion>v1</AzureFunctionsVersion>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
  </PropertyGroup>

yml 文件如下:

variables:
- name: BuildParameters.RestoreBuildProjects
  value: >-
    **/FunctionAppEfs.csproj
- name: solution
  value: >-
   Web/FunctionAppEfs/FunctionAppEfs.csproj 
- name: buildPlatform
  value: >-
    Any CPU
- name: buildConfiguration
  value: >-
    Release

trigger:
  branches:
    include:
    - refs/heads/development
    - refs/heads/master
  batch: True
name: $(date:yyyyMMdd)$(rev:.r)
resources:
  repositories:
  - repository: self
    type: git
    ref: refs/heads/development

jobs:
- job: Phase_1
  displayName: Agent job 1
  timeoutInMinutes: 0
  pool:
    vmImage: vs2017-win2016
  steps:
  - checkout: self
  - task: NuGetToolInstaller@0

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

  - task: GitVersion@5
    inputs:
      runtime: 'full'

  - task: MSBuild@1
    inputs:
      solution: '$(solution)'
      msbuildArchitecture: 'x64'
      msbuildArguments: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'

  - task: PublishBuildArtifacts@1
    displayName: 'Publish artifacts'
    inputs:
      PathtoPublish: $(build.artifactstagingdirectory)
      ArtifactName: 'PublishBuildArtifacts'
...

怎么了?

标签: azure-pipelines.net-framework-version

解决方案



推荐阅读