Web applications Azure DevOps-发布不起作用的特定项目的VSBuild
我有一个解决方案,有大约63个项目,但我的主要目标是大约6个项目。其中3个是DotNet核心API和3个Web应用程序。我能够使用Web applications Azure DevOps-发布不起作用的特定项目的VSBuild,web-applications,azure-devops,msbuild,azure-pipelines,publish,Web Applications,Azure Devops,Msbuild,Azure Pipelines,Publish,我有一个解决方案,有大约63个项目,但我的主要目标是大约6个项目。其中3个是DotNet核心API和3个Web应用程序。我能够使用DotNetCoreCLI@2任务。不幸的是,当我试图发布我的Web应用程序时,我面临以下错误: 错误消息 MSBUILD:错误MSB1006:属性无效。开关: OutputPath:*\WebApplicationMain\Publish YAML - task: VSBuild@1 inputs: solution: '**\WebApplicatio
DotNetCoreCLI@2
任务。不幸的是,当我试图发布我的Web应用程序时,我面临以下错误:
错误消息
MSBUILD:错误MSB1006:属性无效。开关:
OutputPath:*\WebApplicationMain\Publish
YAML
- task: VSBuild@1
inputs:
solution: '**\WebApplicationMain\MainWebApplication.csproj'
msbuildArgs: '/t:build /p:DeployOnBuild=true /p:PublishProfile=publish.pubxml /p:OutputPath:"**\WebApplicationMain\Publish"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
这是我的publish.pubxml
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Staging</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>False</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>Publish</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
</Project>
文件系统
文件系统
登台
任何CPU
假的
假的
发表
真的
网络472
我错过了什么?有什么建议吗?您在
/p:OutputPath:
中使用:
而不是=
,所以只需将其修复为:
/p:OutputPath="some/path"
不确定这是否是正确答案,但它对我有效。我删除了变量$(build.artifactstagingdirectory),并用不同的目录名替换它。我用了“舞台”。我怀疑生成代理不喜欢该特定项目变量中包含的值。您不能在路径中使用
**
。@Shaykibaramczyk Yeah。。我也更改了/p:OutputPath:“\WebApplicationMain\Publish\”并得到一个错误,错误是“MSBUILD:error MSB1008:只能指定一个项目。”请尝试$(build.sourcesdirectory)\WebApplicationMain\Publish
@Shaykibaramczyk我在上面:)哦,我发现了您使用的问题:
,而不是=
,只要把它切换到/p:OutputPath=“some path”
就行了。谢谢:)我甚至使用了路径p:OutputPath=$(build.artifactStagingDirectory)\WebMainPublish\