Open gotztibor opened 1 year ago
Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.
Author: | gotztibor |
---|---|
Assignees: | - |
Labels: | `area-Host`, `untriaged`, `needs-area-label` |
Milestone: | - |
By changing the dotnet/sdk like this would lay out the content files in a simplified way.
Please could someone confirm, that the modification is not absolutely against any design decision and it has sense to raise a pull request.
I think this is not supported.
The project file that you pass to the dotnet store
command is referred to as a "Package Store Manifest". It is supposed to simply be a list of PackageReference
items, and other normal project file elements such as Content
aren't supported.
The package store manifest isn't meant to be built as a normal project. What's the reason for trying to have a Content item in it?
Sorry. I missed to mention, that the same would happen, if You have a "clean" package manifest file only referring some nuget packages but one from those or from the hierarchy contains "content" or "contentFiles". This case the store command will fail, as that is not generating the full destination path for these nuget elements correctly. The responsible msbuild target file from the SDK is the following: src\Tasks\Microsoft.NET.Build.Tasks\targets\Microsoft.NET.Publish.targets
I tried to create some solution as the following: Microsoft.NET.Publish.targets
The reason is, that for these kind of files the previously mentioned target file is not populating the DestinationSubPath property, and therefore the store command (Microsoft.NET.ComposeStore.targets / _CopyResolvedUnOptimizedFiles) would map them simply in a directory, and that is causing the build error.
Is there a specific NuGet package that you were trying to use that has content files in it that we could use to test this?
You can probably work around this by excluding content assets, something like this:
<PackageReference Include="PackageName" Version="<Version>" ExcludeAssets="contentFiles" />
Description
With the attached simple example project the dotnet store command fails upon creation the runtime package store. ExampleContent.zip According to the attached detailed build log.zip, it seems so, that the following is causing the problem:
"C:\Program Files\dotnet\sdk\7.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ComposeStore.targets(345,5): error MSB3024: Could not copy the file "d:\Example\ExampleContent\ExampleContent\Config\ConfigExample.json" to the destination file "d:\rps\x64\net6.0\", because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles. "
The performed command was the following: dotnet store /v:diag --framework net6.0 --runtime win-x64 --framework-version 6.0.16 --skip-optimization --output d:\rps --manifest ExampleContent.csproj
Configuration
.net sdk: 6.0.408 [C:\Program Files\dotnet\sdk] 7.0.302 [C:\Program Files\dotnet\sdk]
.net runtime: Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.13 [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.5 [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.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.13 [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.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
os: Windows 10 21H2 19044.2965 architecture: x64
Other information
The symptom is really the same, if there are nuget packages in the dependency tree with some "files" in the "contentFiles\any" section of the package.