在Visual Studio 2015的Update 2之后,每当我尝试创建一个新的ASP.NET Web应用程序项目时,我都会收到以下错误:
无法加载文件或程序集"Microsoft.VisualStudio.ApplicationInsights.Interfaces,Version = 14.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a"或其依赖项之一.该系统找不到指定的文件.
我有一个服务器插件,它使用WorkItemChangedEventHandler来处理某些特定情况的工作项.TFS实例有3个不同的集合.
对于特定集合,GetWorkItem方法会抛出异常An item with the same key has already been added.消息并停止进一步执行.
WorkItemChangedEvent workItemChange = (WorkItemChangedEvent)notificationEventArgs;
WorkItemStore store = Utils.GetWorkItemStore(requestContext);
IntegerField field = workItemChange.CoreFields.IntegerFields[0];
int workitemId = field.NewValue;
store.GetWorkItem(workitemId);
Run Code Online (Sandbox Code Playgroud)
我正在使用TFS2017 Update 2.
我正在尝试将构建部署到Azure WebApp.
在Azure(http://manage.windowsazure.com)中,我将Web应用程序链接到我的Visual Studio Online(VSTS)帐户.
在VSTS中,我使用单个任务创建了一个发布定义(Azure Web App部署); 任务配置为使用管理模块中定义的端点.服务端点配置为使用凭据.凭据使用的是Microsoft帐户.
发布失败,出现以下错误:
2015-12-02T18:17:35.4422685Z AzurePSCmdletsVersion= 0.9.8.1
2015-12-02T18:17:35.5692677Z Get-ServiceEndpoint -Name foo -Context Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.TaskContext
2015-12-02T18:19:07.5877546Z Username= ********
2015-12-02T18:19:07.5887893Z azureSubscriptionId= foo-foo-foo-foo-foo
2015-12-02T18:19:07.5907904Z azureSubscriptionName= Pay-As-You-Go
2015-12-02T18:19:07.6278127Z Add-AzureAccount -Credential $psCredential
2015-12-02T18:19:09.7755541Z ##[error]-Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and a Microsoft account.
2015-12-02T18:19:09.9664413Z ##[error]There was an error with the Azure credentials used for deployment.
Run Code Online (Sandbox Code Playgroud)
如何设置发布以使用Azure帐户的Microsoft帐户?
azure ms-release-management azure-web-app-service azure-devops
我正在尝试使用PowerShell通过REST API更新构建定义.
使用的脚本是:
$url = "http://tfs:8080/tfs/collection/project/_apis/build/definitions/$($buildId)?api-version=2.0"
$obj = Invoke-RestMethod -Uri $url2 -Method Get -ContentType "application/json" -UseDefaultCredentials
$json = ConvertTo-Json $obj
Invoke-RestMethod -Uri $url -Method Put -Body $json -ContentType "application/json" -UseDefaultCredentials
Run Code Online (Sandbox Code Playgroud)
首先,我尝试了一个新的空定义,我得到以下错误:
该集合必须至少包含一个元素.参数名称:definition.Options.Inputs
所以我添加了一个额外的代码来从返回的json中删除"options"部分:
if($obj.options -ne $null){
$obj.options = $null }
Run Code Online (Sandbox Code Playgroud)
并且更新有效.但是,当我在生产中的"真实"现有构建定义上使用代码时,我得到另一个错误:
该集合必须至少包含一个元素.参数名称:definition.RetentionRules.Rule.Branches.Filter
我正在使用TFS2015 Update 3.
为什么不通过REST API对构建定义进行简单的更新(不做任何修改)?