我正在使用VSTS vNext构建系统来构建C#解决方案.您可以在下面看到NuGet Packager的设置.nuspec文件的路径设置为引用.csproj文件.
但是这包括所有.csproj文件; 我需要排除测试项目.忽略'Core.Test.csproj'但仍然打包'Core.csproj'.
我试过' *.csproj; - :! *test.csproj'和其他组合,但没有运气搞清楚这一点!有谁知道模式匹配如何适用于vNext构建?
我需要为VSTS构建摘要选项卡开发一个相当复杂的UI.我正在使用VS Code作为代码编辑器.以下url描述了如何使用Edge浏览器进行调试,但是这种方法需要不断打包和部署VSTS扩展,这使得它非常耗时. https://www.visualstudio.com/en-us/docs/integrate/extensions/test/debug-in-browser
我尝试使用View In Browser扩展程序直接加载.html(摘要选项卡),并在浏览器控制台中显示以下消息,
No handler found on any channel for message:
{"id":1,"methodName":"initialHandshake","instanceId":"VSS.HostControl","params":[{"notifyLoadSucceeded":true,"vssSDKVersion":2}],"jsonrpc":"2.0","handshakeToken":"4234q23rqfafaf23r"}
Run Code Online (Sandbox Code Playgroud)
开发时有没有更好的方法来调试应用程序?
我在MS教程之后为TFS创建了一个新的扩展.出于某种原因,当我将Icon添加到我的扩展程序时,我可以在安装扩展程序时在"Extension Manager"页面中看到此图标,
但是当我从构建步骤菜单中选择我的扩展时,图像丢失了.
在"vss-extension.json"文件中,我添加了:
"icons": {
"default": "images/icon.png"
},
"files": [
{
"path": "images",
"addressable": true
},
{
"path": "dist",
"addressable": true,
"packagePath": "scripts"
},
{
"path": "infoTab.html",
"addressable": true
},
{
"path": "node_modules/vss-web-extension-sdk/lib",
"addressable": true,
"packagePath": "lib"
},
{
"path": "buildtask"
}
],
Run Code Online (Sandbox Code Playgroud)
图像文件是32x32
该图像是否应该在"task.json"文件中引用?
我的ARM模板资源组部署在VSTS中失败.
我得到一个错误,没有任何具体问题的参数参考:"其中一个部署参数有一个空键.详情请参阅https://aka.ms/arm-deploy/#parameter-file."
引用的url包含一般信息,一条注释询问相同的问题,但没有答案.有人要求它避免它可能与部署步骤(2.*)的版本有关,而且它不再使用Powershell.我通过模板来回比较BeyondCompare中的参数,没有任何内容......
有谁知道这个错误意味着什么?
deployment parameters azure-resource-manager azure-pipelines-build-task azure-resource-group
我正在尝试为大型解决方案设置自动构建和部署。单个解决方案在“ $(Build.ArtifactStagingDirectory)”位置生成2个zip文件夹,其中包含所有正确的文件。出于测试/故障排除的目的,我仅查看这些zip文件之一,但是最终两个站点都必须采用这种方式进行部署。
但是,要获取实际文件,您必须通过14个不必要的子文件夹。更复杂的是,其中的8个是可变的,具体取决于构建配置的某些元素(某些归因于git repo中的文件夹结构)。
我不需要这些子文件夹。另一个问题是我实际上并不需要100%的平面文件。我需要2个带有子文件夹的文件夹才能包含在最终提取的目录中。(最终目录是IIS站点的物理路径。)是否可以执行此操作?
我试过了:
提取生成的zip文件,将其解压缩到temp目录,然后重新打包,所有这些都在构建机器上。
从VSTS下载已发布的zip文件,在发布计算机上本地将其解压缩,然后将内容复制到正确的目录中。
使用复制对话框中的“ Flatten Folders”高级选项。
如果不可能仅将构建步骤生成的zip文件部分压扁,我将不胜感激,可以帮助您弄清楚我可以使用变量拉出多少条令人费解的路径。
azure-devops azure-pipelines-build-task azure-pipelines azure-pipelines-release-pipeline
我有一个vsts构建定义,其中我尝试使用PowerShell(以及我尝试cmd之前)任务设置PATH环境变量,以便在以后的vsTest任务中,测试可以从该路径运行exe,但是使用设置PATH ps\cmd任务似乎不起作用,我尝试了几个选项,如:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + $newPath, [EnvironmentVariableTarget]::User)
setx path " %newPath;%PATH%"
Run Code Online (Sandbox Code Playgroud)
有什么建议?
vstest azure-devops azure-pipelines-build-task azure-pipelines
我已经在TFS / AzureDevops构建定义中定义了一个变量(例如time
),并在构建定义中使用PowerShell任务分配了值。
喜欢,
类型:内联脚本。
内联脚本:
$date=$(Get-Date -Format g);
Write-Host "##vso[task.setvariable variable=time]$date"
Run Code Online (Sandbox Code Playgroud)
你可以参考这个类似的例子
现在,我想在发布定义管道中获取此值。我将此构建定义配置为对发布定义的持续部署。
如何time
使用其他变量在发布定义中获取值?这可能吗?
tfs azure-devops azure-pipelines-build-task azure-pipelines azure-pipelines-release-task
运行具有以下项目/文件夹结构的Azure Build Pipeline时,我遇到了问题(不需要的行为).
我的存储库的根文件夹有两个主文件夹:
我正在尝试为后端构建一个单独的Azure管道,为前端构建一个,所以我使用该projects:
参数指定正确的路径.
该build
和test
命令运行良好,并只还原/建筑/测试backend
文件夹,但该publish
命令运行这两个文件夹:后端和前端.
这是我的yaml文件:
#build backend project
task: DotNetCoreCLI@2
displayName: dotnet build --configuration $(buildConfiguration)
name: BuildBackendProject
inputs:
command: build
projects: '**/backend/**/*.csproj'
arguments: '--configuration $(buildConfiguration)'
... #run some tests
#publish backend project
task: DotNetCoreCLI@2
displayName: dotnet publish backend --configuration $(buildConfiguration)
name: PublishBackendProject
inputs:
command: publish
projects: '**/backend/**/*.csproj'
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output
$(Build.ArtifactStagingDirectory)/backend'
zipAfterPublish: True
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的文件夹路径,但它总是运行两个发布命令.
如果我在CMD中本地运行dotnet publish backend …
azure-devops asp.net-core azure-pipelines-build-task azure-pipelines
我在azure构建管道中配置了powershell任务,以将来自dev的更改合并到我的github公共仓库的master中,并将更改推送到master。我正进入(状态
严重:无法读取“ https://github.com ”的用户名:禁用终端提示
注意:
任何帮助,将不胜感激。如果需要更多信息,请在此线程中进行注释。
这是实际的代码段。
$branchName = $env:BRANCH_NAME;
Write-Host "Getting SHA for last commit in the latest release" -ForegroundColor Blue;
$latestReleaseCommitSHA = git rev-list --tags --max-count=1;
if([string]::IsNullOrEmpty($latestReleaseCommitSHA)) {
Write-Host "Unable to get the SHA for last commit in latest release" -ForegroundColor Red;
EXIT 1;
}
Write-Host "SHA for last commit in the latest release is '$($latestReleaseCommitSHA)'" -ForegroundColor Green;
Write-Host "Merging Changes till '$($latestReleaseCommitSHA)'" -ForegroundColor Blue;
git merge $latestReleaseCommitSHA
Write-Host "Checking Conflicted Files";
$conflictedFiles = …
Run Code Online (Sandbox Code Playgroud) git powershell azure-devops azure-pipelines-build-task azure-pipelines
有人知道是否可以将VS2019与TFS2018 vnext构建系统一起使用。您不能在构建定义中选择VS2019,但可以选择“最新”作为Visual Studio的版本。不幸的是,这并未选择VS2019。
我已经在安装了VS2017和VS2019的虚拟机中对此进行了测试。我还将TFS2018升级到Azure DevOps Server 2019,从而解决了该问题。但这对于我们的生产环境不是一个“快速”的解决方案。
这是我测试的日志。如您所见,选择“最新”作为Visual Studio的版本以错误告终,根本没有选择VS:
TFS2018 / VS2017:
2019-04-05T07:38:58.8044647Z ##[debug]Entering Select-VSVersion.
2019-04-05T07:38:58.8080670Z ##[debug] PreferredVersion: '15.0'
2019-04-05T07:38:58.8363094Z ##[debug]Entering Get-VSPath.
2019-04-05T07:38:58.8393121Z ##[debug] Version: '15.0'
2019-04-05T07:38:58.8464182Z ##[debug]Entering Get-VisualStudio_15_0.
2019-04-05T07:38:58.8516552Z ##[debug]Getting latest Visual Studio 15 setup instance.
2019-04-05T07:38:58.8727275Z ##[debug]Entering Invoke-VstsTool.
2019-04-05T07:38:58.8759258Z ##[debug] FileName: 'C:\b\a1\_w\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.126.0\ps_modules\MSBuildHelpers\vswhere.exe'
2019-04-05T07:38:58.8790622Z ##[debug] Arguments: '-version [15.0,16.0) -latest -format json'
2019-04-05T07:38:58.8861580Z ##[debug] RequireExitCodeZero: 'True'
2019-04-05T07:38:58.8899897Z ##[command]"C:\b\a1\_w\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.126.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [15.0,16.0) -latest -format json
2019-04-05T07:38:58.9699602Z ##[debug][
2019-04-05T07:38:58.9775093Z ##[debug] {
2019-04-05T07:38:58.9805669Z ##[debug] "instanceId": "716a72e1",
2019-04-05T07:38:58.9836484Z ##[debug] "installDate": "2018-06-19T06:36:30Z",
2019-04-05T07:38:58.9866720Z ##[debug] "installationName": "VisualStudio/15.9.11+28307.586", …
Run Code Online (Sandbox Code Playgroud) azure-pipelines-build-task visual-studio-2019 azure-devops-server-2019
azure-pipelines-build-task ×10
azure-devops ×8
tfs ×3
asp.net-core ×1
azure-pipelines-release-pipeline ×1
azure-pipelines-release-task ×1
deployment ×1
git ×1
parameters ×1
powershell ×1
vstest ×1