Open jessehouwing opened 4 years ago
Or should the guidance here really be: create 2 nuget packages.
@jessehouwing
Do you have a sample app? I wonder how can one conditionally provide Dependencies for Platform specific targets. There's no "Platform" attribute supported in NuSpec too.
In the end I converted the whole project to AnyCPU with dynamic library loading and got rid of the platform specific build outputs.
@jessehouwing how did you do that? I.e. we want to make a Nuget package, that has both x86 and x64 dlls in it, and BOTH should be built, and then .NET assembly, which checks dynamically if it's running x86 or x64 and loads one of those dll to use. We have a problem to creating a nuget, that has both dlls, which get copied to the build folder (/bin/Debug/ or Release or whatever) for the end user, who adds our Nuget. Could you please share, how to correctly pack that for .NET STANDART?
I did this at a client and no longer have access to that codebase. Sorry.
If I remember correctly we ended up with an any cpu project with the dotnet any put assemblies in them, a content folder with a x64 and an x86 folder with the respective native binaries in them.
A piece of MS build target file to copy the binaries to the output directory.
On Fri, 2 Apr 2021, 12:07 ArsenijK, @.***> wrote:
@jessehouwing https://github.com/jessehouwing how did you do that? I.e. we want to make a Nuget package, that has both x86 and x64 dlls in it, and BOTH should be built, and then .NET assembly, which checks dynamically if it's running x86 or x64 and loads one of those dll to use. We have a problem to creating a nuget, that has both dlls, which get copied to the build folder (/bin/Debug/ or Release or whatever) for the end user, who adds our Nuget. Could you please share, how to correctly pack that for .NET STANDART?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NuGet/Home/issues/9369#issuecomment-812465523, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA724S5D3UT4GY3T4NCX5CLTGWJNLANCNFSM4LYBRAGA .
Details about Problem
I've been trying to craft a nuspec file (to be used with nuget.exe pack) to create a nupack that has the following elements:
All of these target net46 and above.
I've created a reference assembly as well by now.
This is what the nuspec looks like:
I can't get the references to
MyProject.Reporting.dll
andMyProject.dll
to appear in the editor after adding the nuget file.nuget pack
complains it can't find the assemblies:I've searched all over and have stumbled upon many similar questions, but everyone seems to get stuck on the exact pieces of the puzzle on this problem. It looks as if it may be working for .NET Core and UWP from what I gather from the samples and the docs, but I'm not entirly sure of that either.
NuGet version: 5.5.0.6473 VS version (if appropriate): 2019 OS version (i.e. win10 v1607 (14393.321)): win10 2004 19041.172
Detailed repro steps so we can see the same problem
See above nuspec
Other suggested things
All multi-platform examples here show UWP: https://github.com/NuGet/docs.microsoft.com-nuget/blob/master/docs/create-packages/Supporting-Multiple-Target-Frameworks.md Similar issues linked to the docs page: https://github.com/NuGet/docs.microsoft.com-nuget/issues?utf8=%E2%9C%93&q=%22d70bd2f5-c04b-9207-62a0-4ecb6e8e5ca6%22&in=body Docs page: https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks Many similar questions on Stackoverflow with all kinds of solutions, but none seem to come close to what these docs suggest... https://www.bing.com/search?q=nuget+package+x86+x64+site%3astackoverflow.com