标签: azure-pipelines

Azure Pipeline - 使用 .NET 8 RC2 SDK 构建 C# 项目失败

我们有一个 Azure Function 应用程序项目,它可以使用 .NET 8 RC2 SDK 在本地构建良好。但是,当通过 Azure Pipeline 进行构建时,在恢复 NuGet 包步骤期间会失败,并引发以下错误:

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.<DetermineInputsFromMSBuildAsync>d__63.MoveNext()
##[error]The nuget command failed with exit code(1) and error(D:\a\1\s\some.API.csproj : error : Could not resolve SDK "Microsoft.NET.Sdk". 
Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.

D:\a\1\s\SOME.API.csproj : error :   Unable to locate the .NET SDK. Check that it is installed, your PATH is configured …
Run Code Online (Sandbox Code Playgroud)

.net azure .net-core azure-functions azure-pipelines

4
推荐指数
1
解决办法
2802
查看次数

Azure DevOps 中的 .NET 8 给出“错误 NETSDK1112:未下载 Microsoft.NETCore.App.Runtime.win-x64 的运行时包”

我已将 MSIX WPF 应用程序从 .NET 7 升级到 .NET 8,并且它在我自己的计算机上运行良好。但是当我尝试在 Azure DevOps 中构建它时,我收到错误:

C:\agent\_work\_tool\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(491,5): 
Error NETSDK1112: The runtime pack for Microsoft.NETCore.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.

C:\agent\_work\_tool\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(491,5): Error NETSDK1112: The runtime pack for Microsoft.WindowsDesktop.App.Runtime.win-x64 was not downloaded. Try running a NuGet restore with the RuntimeIdentifier 'win-x64'.
Run Code Online (Sandbox Code Playgroud)

我在本地构建服务器上和使用托管代理时都会遇到相同的错误。

我使用这些任务在计算机上安装和验证 .NET 8:

- task: UseDotNet@2
  inputs:
    version: '8.x'

- task: PowerShell@2
  displayName: 'Check .NET Version and SDKs'
  inputs:
    targetType: 'inline'
    script: |    
        dotnet --version
        dotnet --list-sdks …
Run Code Online (Sandbox Code Playgroud)

.net c# azure-pipelines msix

4
推荐指数
1
解决办法
1541
查看次数

VSTS Powershell秘密变量

如何在我的版本定义中的powershell脚本中使用秘密变量?

我遇到过这个,但它不起作用."$($env:AGENT_HOMEDIRECTORY)\agent\worker\Modules"新代理上不存在该目录.

在新主机上访问秘密变量的正确方法是什么?我的代理版本是2.114.0.

powershell azure-pipelines azure-pipelines-release-pipeline azure-devops-rest-api

3
推荐指数
1
解决办法
4958
查看次数

Azure私人生成代理:找不到具有以下功能的代理:npm,azureps

我正在尝试使用本地服务器作为构建代理来构建项目。服务器已经有

  • VS 2015,
  • VS 2017
  • 通过NVM的节点6,7,8
  • 通过NVM的NPM 4,5,6

我可以通过npm build或yarn build在本地构建项目。

我已经下载并配置并注册了私有构建代理,并且已将其保存在门户网站的代理池中-xxx.visualstudio.com/xxx。

但是,当我尝试从门户计划构建时,将显示以下消息:

找不到具有以下功能的代理:npm,azureps

我需要解决什么才能使构建可以在本地运行?

azure-devops azure-pipelines azure-devops-self-hosted-agent

3
推荐指数
1
解决办法
4148
查看次数

VSTS:## [error]未找到提供的环境变量的值

我花了很多时间试图弄清楚这一个,根本不能.FWIW,这个项目可以从本地命令行和TeamCity中完成.它也建立在VSTS上,但是这个错误使任务失败.什么环境变量是在visualstudio.com构建中寻找的Nuget包任务?

以下是相关文件和任务配置:

package.nuspec:

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>VDS.AppCore.Formatters</id>
    <version>$version$</version>
    <title>VDS AppCore Formatters</title>
    <authors>Visual Data Solutions, Inc.</authors>
    <owners>Visual Data Solutions, Inc.</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>VDS AppCore Formatters</description>
    <copyright>Copyright © Visual Data Solutions, Inc. 2010-2017</copyright>
  </metadata>
  <files>
    <file src="$SolutionDir$VDS.AppCore.Formatters\bin\$Configuration$\VDS.AppCore.Formatters.dll" target="lib\net45" />
    <file src="$SolutionDir$VDS.AppCore.Formatters\bin\$Configuration$\VDS.AppCore.Formatters.pdb" target="lib\net45" />
    <file src="$SolutionDir$VDS.AppCore.Formatters\**\*.cs" target="src" />
  </files>
</package>
Run Code Online (Sandbox Code Playgroud)

的.csproj

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{BED8C9D5-954F-47AA-9BDA-531D125209C0}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>VDS.AppCore.Formatters</RootNamespace>
    <AssemblyName>VDS.AppCore.Formatters</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup> …
Run Code Online (Sandbox Code Playgroud)

nuget nuspec azure-devops azure-pipelines

3
推荐指数
1
解决办法
1047
查看次数

找不到代理队列

我最近导出并导入了一个VSTS构建流程定义,以便为类似项目创建类似的构建.但是,当我尝试保存定义时,VSTS会显示以下错误:

"没有找到带有标识符x的代理队列."

有谁知道原因?我看了一些其他在线帖子,他们与安全设置有关,这些都是正确的.

还有一些与构建功能相关,但这不是例外.

azure-pipelines

3
推荐指数
1
解决办法
1656
查看次数

VSTS - 构建定义 - 多个代理

在VSTS onlie中,我们创建了一个私有池,并创建了两个代理(Say A,B).我们想要创建一个包含两个阶段的构建定义.

是否可以在代理A上运行第一阶段,在代理B上运行第二阶段?

每个阶段,在代理商选择中显示<inherit from definition>而不是我们创建的代理商可供选择.

azure-devops azure-pipelines

3
推荐指数
1
解决办法
744
查看次数

安装程序使用VSTS发布到文件夹

publish to folder通过右键单击项目->发布->发布到文件夹,通过Visual Studio 使用选项。结果始终是具有应用转换的易于复制的项目。我想使用VSTS自动化此过程,并在VSTS上进行设置。
我用下面的步骤:
- NuGet restore
- Build solution
- Publish Build Artifacts$(build.artifactstagingdirectory)
- Windows machine file copy$(build.artifactstagingdirectory)使用远程机器admin loginpassword

最后,我在具有复杂文件夹结构的远程计算机上获得了zip软件包,而根本没有在其中进行任何转换。
怎么了?如何使用VSTS设置与Visual Studio中相同的“发布到文件夹”?

web-publishing one-click-web-publishing continuous-delivery azure-devops azure-pipelines

3
推荐指数
2
解决办法
3664
查看次数

VSTS构建任务输入类型

我用Google搜索了几天来获取VSTS Task插件支持的输入类型列表,但没有得到任何合适的信息.

这可以在任务插件中创建Grid

azure-pipelines-build-task azure-pipelines azure-pipelines-release-pipeline

3
推荐指数
1
解决办法
3128
查看次数

MSBuild参数生成文件

注意:具有MVC Web应用程序和其他几个项目的Visual Studio 2017解决方案,Web应用程序项目未引用所有这些项目。到目前为止,我一直直接使用VS来发布到测试服务器,但是我已经将其移到VSTS中,并且具有构建和发布定义设置,但尚无法正常工作。

我要实现的目标是让我的(托管)VSTS构建代理生成发布的文件,这些文件可以由我的(本地)发布代理简单地复制到其目标位置。因此,我试图从VS命令行在本地测试MS构建步骤,以获取生成的文件并记下它们所在的路径。也许我让这变得更复杂了吗?

这些选项将创建一个单独的压缩存档及其关联文件,并将其放置在工件临时目录中。有没有一种方法可以简单地发布文件,而无需将其存储在存档中,而是直接将其存储在工件暂存目录中?

Visual Studio构建

MSBuild参数

/t:My_MVCWeb_Project_Name /p:DeployOnBuild=true 
/p:WebPublishMethod=FileSystem /p:PackageAsSingleFile=true 
/p:SkipInvalidConfigurations=true 
/p:PackageLocation="$(build.artifactstagingdirectory)\\"
Run Code Online (Sandbox Code Playgroud)

在我使用本地代理发布的版本中,我有一个“复制文件”任务,目标是IIS应用程序所在的unc路径。但是,这只会复制存档。那么,如何像使用发布配置文件一样直接将文件复制到应用程序目录?

[update2-仍在生成zip文件]

MSBuild my_solution_name /t:"my_project_name" /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:SkipInvalidConfigurations=true /p:PackageLocation="D:\temp\local-dev-build-dir"
Run Code Online (Sandbox Code Playgroud)

[update 3]从命令行尝试这些作为测试,但是什么也没有生成

msbuild D:\app_dir>MSBuild my_solution_name.sln /t:"my_web_proj_name" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="D:\temp\app_build_dir\\" 
/p:DeployDefaultTarget=WebPublish  
Run Code Online (Sandbox Code Playgroud)

msbuild azure-devops azure-pipelines

3
推荐指数
2
解决办法
3979
查看次数