我正在使用 azure 管道部署我的 net core 2.2 应用程序
yml:
trigger:
- dev
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Debug'
steps:
- task: NuGetToolInstaller@1
- task: UseDotNet@2
displayName: 'Use dotnet sdk 2.2'
inputs:
version: 2.x
includePreviewVersions: false
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
# code coverage
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/*Tests/*.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
- script: dotnet -d ef -v migrations script --output $(Build.ArtifactStagingDirectory)\SQL\$(scriptName) --context $(dbContext) --idempotent --project src\WorkFlowManager.EntityFrameworkCore\WorkFlowManager.EntityFrameworkCore.csproj
- task: PublishBuildArtifacts@1
现在我在解决方案中添加了一个我想从构建中排除的天蓝色函数项目,因为最后一个项目是使用 net core 3.1 开发的。
我正在尝试使用类似的方法将其从管道中排除:
variables:
solution: |
'**/*.sln'
'!**/*Project.AzureFunction*.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Debug'
但是构建不起作用:
Starting: VSBuild
==============================================================================
Task : Visual Studio build
Description : Build with MSBuild and set the Visual Studio version property
Version : 1.166.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
==============================================================================
##[error]Solution not found using search pattern ''**\*.sln'
'!**\*WorkFlowManager.Functions.EnelGenerator*.csproj'
'.
Finishing: VSBuild
有任何想法吗?