Skip to content

[8.0 preview 3] NuGet package validation fails when UseArtifactsOutput=true #31882

@martincostello

Description

@martincostello

Describe the bug

If UseArtifactsOutput=true and NuGet package validation is enabled, an error occurs when running dotnet pack.

It appears that the package validation functionality does not understand the new layout of the output, and looks in the wrong folder for the .nupkg file to validate.

Specifically, there appears to be a dangling _ in the name of the folder, I'm guessing because it's expecting there to be a TFM there.

MSBuild version 17.6.0-preview-23174-01+e7de13307 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(287,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [src\Logging.XUnit\MartinCostello.Logging.XUnit.csproj::TargetFramework=netstandard2.0]
  MartinCostello.Logging.XUnit -> .artifacts\bin\MartinCostello.Logging.XUnit\release_netstandard2.0\MartinCostello.Logging.XUnit.dll
  Successfully created package '.artifacts\package\release\MartinCostello.Logging.XUnit.0.3.1.nupkg'.
  Successfully created package '.artifacts\package\release\MartinCostello.Logging.XUnit.0.3.1.snupkg'.
C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(58,5): error MSB3371: The file ".artifacts\obj\MartinCostello.Logging.XUnit\release_\Microsoft.NET.ApiCompat.ValidatePackage.semaphore" cannot be created. Could not find a part of the path '.artifacts\obj\MartinCostello.Logging.XUnit\release_\Microsoft.NET.ApiCompat.ValidatePackage.semaphore'. [src\Logging.XUnit\MartinCostello.Logging.XUnit.csproj]

To Reproduce

Exceptions (if any)

C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(58,5): error MSB3371: The file ".artifacts\obj\MartinCostello.Logging.XUnit\release_\Microsoft.NET.ApiCompat.ValidatePackage.semaphore" cannot be created. Could not find a part of the path '.artifacts\obj\MartinCostello.Logging.XUnit\release_\Microsoft.NET.ApiCompat.ValidatePackage.semaphore'. [src\Logging.XUnit\MartinCostello.Logging.XUnit.csproj]

Further technical details

❯ dotnet --info
.NET SDK:
 Version:   8.0.100-preview.3.23178.7
 Commit:    e300b0e1e6

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.0-preview.3.23174.8
  Architecture: x64
  Commit:       47bad717bd

.NET SDKs installed:
  6.0.116 [C:\Program Files\dotnet\sdk]
  6.0.408 [C:\Program Files\dotnet\sdk]
  7.0.203 [C:\Program Files\dotnet\sdk]
  7.0.300-preview.23179.2 [C:\Program Files\dotnet\sdk]
  8.0.100-preview.3.23178.7 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-preview.3.23177.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-preview.3.23174.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0-preview.3.23178.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\Coding\martincostello\xunit-logging\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions