You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-x86\native\libSkiaSharp.dll' is not added because the package already contains file 'content\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-x86\native\libSkiaSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-x64\native\libSkiaSharp.dll' is not added because the package already contains file 'content\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-x64\native\libSkiaSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-x64\native\libSkiaSharp.dll' is not added because the package already contains file 'content\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-x64\native\libSkiaSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-arm64\native\libSkiaSharp.dll' is not added because the package already contains file 'content\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-arm64\native\libSkiaSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-arm64\native\libSkiaSharp.dll' is not added because the package already contains file 'content\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\skiasharp.nativeassets.win32\2.88.0\runtimes\win-arm64\native\libSkiaSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libSkiaSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-x86\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'content\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-x86\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-x64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'content\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-x64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-x64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'content\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-x64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-arm64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'content\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-arm64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-arm64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'content\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5118: File 'C:\Users\username\.nuget\packages\harfbuzzsharp.nativeassets.win32\2.8.2.3\runtimes\win-arm64\native\libHarfBuzzSharp.dll' is not added because the package already contains file 'contentFiles\any\net472\libHarfBuzzSharp.dll'
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5100: The assembly 'content\libSkiaSharp.dll' is not inside the 'lib' folder and hence it won't be added as a reference when the package is installed into a project. Move it into the 'lib' folder if it needs to be referenced.
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5100: The assembly 'contentFiles\any\net472\libSkiaSharp.dll' is not inside the 'lib' folder and hence it won't be added as a reference when the package is installed into a project. Move it into the 'lib' folder if it needs to be referenced.
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5100: The assembly 'content\libHarfBuzzSharp.dll' is not inside the 'lib' folder and hence it won't be added as a reference when the package is installed into a project. Move it into the 'lib' folder if it needs to be referenced.
C:\Program Files\dotnet\sdk\6.0.407\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5100: The assembly 'contentFiles\any\net472\libHarfBuzzSharp.dll' is not inside the 'lib' folder and hence it won't be added as a reference when the package is installed into a project. Move it into the 'lib' folder if it needs to be referenced.
0 Warning(s)
24 Error(s)
Workarround
Adding these properties to my csproj ensure the native files are not added as content
<!-- Workarround to ensure the Native files of SkiaSharp and Harfbuzz are not included in the package -->
<ShouldIncludeNativeSkiaSharp>False</ShouldIncludeNativeSkiaSharp>
<ShouldIncludeNativeHarfBuzzSharp>False</ShouldIncludeNativeHarfBuzzSharp>
Expected Behavior
I expect a NuGet package of my assembly is generated containing my assembly and a dependency on the SkiaSharp package.
The assemblies part of the SkiaSharp and Harfbuzz packages should not be considered as input files to pack.
Actual Behavior
MSBuild fails with the below error. The SkiaSharp (and HarfBuzz) win32 package is injecting the native assemblies as content. Which is picked up by MSBuild.
Possible solution
The build targets included in the package contain logic to have it included as content.
One solution could be to use a None include instead of a Content included
Another solution could be to also set the Pack attribute, to ensure the content files is not considered as a file to pack.
I have a similar behavior with the native SkiaSharp libraries being included throughout all transitive dependencies
Ex:
AppA -> LibA -> LibB -> SkiaSharp
AppA, LibA and LibB will all embed the native dependencies in the nupkg, even when AppA end LibA are pulling it transitively
I have added the following code to Directory.Build.targets, but would prefer to have the Pack property set in the nuget's .props file, as is outlined in the bug report as a possible solution.
This problem still occurs when building NuGet-Packages. I'm using version 2.88.6.
Sometimes, but not always, an error occurs during compilation when the compiler tries to copy the DLLs into the bin directory.
We also have to start our application from the bin folder, but we also pack NuGet packages for some assemblies.
Description
When referencing the SkiaSharp package (2.88.0) in a csproj where NuGet pack is enabled using
The following errors are generated
Code
Workarround
Adding these properties to my csproj ensure the native files are not added as content
Expected Behavior
I expect a NuGet package of my assembly is generated containing my assembly and a dependency on the SkiaSharp package.
The assemblies part of the SkiaSharp and Harfbuzz packages should not be considered as input files to pack.
Actual Behavior
MSBuild fails with the below error. The SkiaSharp (and HarfBuzz) win32 package is injecting the native assemblies as content. Which is picked up by MSBuild.
Possible solution
The build targets included in the package contain logic to have it included as content.
One solution could be to use a None include instead of a Content included
Another solution could be to also set the Pack attribute, to ensure the content files is not considered as a file to pack.
Basic information
Using Visual Studio 2022 17.4 and .NET 6 SDK version 6.0.407
The text was updated successfully, but these errors were encountered: