我试图在构建后打包一个库以在我的 VSTS 包源上发布。
但是 Nuget Packager 任务不起作用。我尝试了很多设置组合,但我无法使其工作。
我尝试使用 .Net Core 和 .Net 4.6.2 打包库。
尝试使用 .Net Core 或 .Net 4.6.2 打包时出现以下错误:
##[错误]项目的默认 XML 命名空间必须是 MSBuild XML 命名空间。如果项目是以 MSBuild 2003 格式创作的,请将 xmlns="http://schemas.microsoft.com/developer/msbuild/2003" 添加到元素中。如果项目是以旧的 1.0 或 1.2 格式创作的,请将其转换为 MSBuild 2003 格式。d:\a\12\s\myproject.csproj
我正在使用以下设置:
代理:主办2017
内部版本号格式:$(date:yyyyMMdd).$(rev:.r).0
.net 核心的 .csproj 如下:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<Import Project="..\..\myproject.shared.projitems" Label="Shared" />
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="WindowsAzure.Storage" Version="8.1.1" />
</ItemGroup>
</Project>
.Net Core 的完整日志是:
2017-05-16T12:25:40.4059161Z ##[section]Starting: NuGet Packager
2017-05-16T12:25:40.4069169Z ==============================================================================
2017-05-16T12:25:40.4069169Z Task : NuGet Packager
2017-05-16T12:25:40.4069169Z Description : Creates nupkg outputs from csproj or nuspec files
2017-05-16T12:25:40.4069169Z Version : 0.1.72
2017-05-16T12:25:40.4069169Z Author : Lawrence Gripper
2017-05-16T12:25:40.4069169Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=627416)
2017-05-16T12:25:40.4069169Z ==============================================================================
2017-05-16T12:25:42.1843658Z Preparing task execution handler.
2017-05-16T12:25:47.7782379Z Executing the powershell script: d:\a\_tasks\NuGetPackager_333b11bd-d341-40d9-afcf-b32d5ce6f24b\0.1.72\NuGetPackager.ps1
2017-05-16T12:25:48.1582506Z Find-Files -SearchPattern d:\a\12\s\**\*.csproj -RootFolder d:\a\12\s
2017-05-16T12:25:48.1582506Z
2017-05-16T12:25:48.1582506Z
2017-05-16T12:25:48.2452532Z C:\LR\MMS\Services\mms\TaskAgentProvisioner\Tools\agents\2.116.1\externals\nuget\NuGet.exe pack "d:\a\12\s\SpaceNeedle.NetFX\Net4\SpaceNeedle.NetFX.Net4\SpaceNeedle.NetFX.Net4.csproj" -OutputDirectory "d:\a\12\s" -Properties Configuration=release
2017-05-16T12:25:49.5712932Z MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
2017-05-16T12:25:49.5712932Z Attempting to build package from 'SpaceNeedle.NetFX.Net4.csproj'.
2017-05-16T12:25:50.6143198Z Packing files from 'd:\a\12\s\SpaceNeedle.NetFX\Net4\SpaceNeedle.NetFX.Net4\bin\Release'.
2017-05-16T12:25:50.9343273Z Found packages.config. Using packages listed as dependencies
2017-05-16T12:25:50.9463282Z WARNING: Description was not specified. Using 'Description'.
2017-05-16T12:25:51.0333303Z Successfully created package 'd:\a\12\s\SpaceNeedle.NetFX.Net4.0.1.0.0.nupkg'.
2017-05-16T12:25:51.0763302Z C:\LR\MMS\Services\mms\TaskAgentProvisioner\Tools\agents\2.116.1\externals\nuget\NuGet.exe pack "d:\a\12\s\SpaceNeedle.NetFX\NetFX\SpaceNeedle.NetFX\SpaceNeedle.NetFX.csproj" -OutputDirectory "d:\a\12\s" -Properties Configuration=release
2017-05-16T12:25:51.4743413Z MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework\v4.0.30319'.
2017-05-16T12:25:51.4863414Z Attempting to build package from 'SpaceNeedle.NetFX.csproj'.
2017-05-16T12:25:51.5313430Z ##[error]The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. d:\a\12\s\SpaceNeedle.NetFX\NetFX\SpaceNeedle.NetFX\SpaceNeedle.NetFX.csproj
2017-05-16T12:25:51.5703444Z ##[error]System.Exception: Unexpected exit code 1 returned from tool NuGet.exe
2017-05-16T12:25:51.5703444Z at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeToolCmdlet.ProcessRecord()
2017-05-16T12:25:51.5713439Z at System.Management.Automation.CommandProcessor.ProcessRecord()
2017-05-16T12:25:51.5943443Z ##[error]PowerShell script completed with 1 errors.
2017-05-16T12:25:51.5953445Z ##[section]Finishing: NuGet Packager
有谁知道发生了什么?
谢谢!