We are using Arcade to build and publish a nuget package for https://github.com/dotnet/spark . [Content_Types].xml contained in the generated nupkg contains a line for the LICENSE file with leading double slashes // .
[Content_Types].xml contents:
<?xml version="1.0" encoding="utf-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
<Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
<Default Extension="dll" ContentType="application/octet" />
<Default Extension="xml" ContentType="application/octet" />
<Default Extension="TXT" ContentType="application/octet" />
<Default Extension="jar" ContentType="application/octet" />
<Default Extension="targets" ContentType="application/octet" />
<Default Extension="nuspec" ContentType="application/octet" />
<Override PartName="//LICENSE" ContentType="application/octet" />
</Types>
This is causing some issues with a pipeline that is consuming our nuget package. The expected behavior should produce a line with a single forwardslash, ie <Override PartName="/LICENSE" ContentType="application/octet" />
The Directory.Build.props containing the LICENSE settings is located at https://github.com/dotnet/spark/blob/master/src/csharp/Directory.Build.props
Do you have any recommendations on how we can get a single / for the xml attribute value ?
Cc: @imback82
cc: @eerhardt
Note - this behavior is due to NuGet, and not caused by arcade. I can repro this behavior in a vanilla .NET library.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)LICENSE"
Pack="true"
PackagePath="\"
Visible="false" />
</ItemGroup>
</Project>
Calling dotnet pack on that library will produce a [Content_Types].xml file with a double slash.
I think there are 2 ways to fix this.
PackageLicenseFile at all, but instead use PackageLicenseExpression.Copyright (c) 2019 .NET Foundation, which isn't shown when using the PackageLicenseExpression.PackagePath="\" to PackagePath="".Thanks @eerhardt for the suggestion. We will try 2). Closing this since this is not related to Arcade.
Most helpful comment
Note - this behavior is due to NuGet, and not caused by arcade. I can repro this behavior in a vanilla .NET library.
Calling
dotnet packon that library will produce a[Content_Types].xmlfile with a double slash.I think there are 2 ways to fix this.
PackageLicenseFileat all, but instead usePackageLicenseExpression.Copyright (c) 2019 .NET Foundation, which isn't shown when using the PackageLicenseExpression.PackagePath="\"toPackagePath="".