Creating an x86/x64 nuget package without nusepc in new csproj format

Karsten Schramm 0 Reputation points
2023-09-20T06:23:39.36+00:00

One of the drawbacks of the nuspec file is that you need to list you nuget dependencies all over again and don't you dare forget it when updating one of your dependencies. For example here.

As a test balloon I was trying to achieve the same goal with the new Microsoft.NET.Sdk project style.

With the help from StackOverflow here and StackOverflow here I was able to generate a nuget package if it contains x86, x64 and AnyCPU. But I don't want AnyCPU.

Because for some reason the dotnet pack command insists on finding the DLL in the default folder:

dotnet pack DoenaSoft.NugetTest\DoenaSoft.NugetTest.csproj --no-build -c=Release -o=./

error NU5026: The file '{...}\bin\Release\net472\DoenaSoft.NugetTest.dll'
to be packed was not found on disk. [{...}\DoenaSoft.NugetTest.csproj]

And I can't convince it that I neither want nor need a non-x86/x64 library in my nuget pack

Build script and everything here on Github

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.