microsoft / WPFDXInterop

Repo for WPF DX Interop support
MIT License
307 stars 98 forks source link

Unified platform/architecture nuget #11

Open oysteinkrog opened 8 years ago

oysteinkrog commented 8 years ago

Hi,

It's possible to create a single unified nuget package by using the LoadLibrary trick (name both x86/x64 dll's the same name, ensure all pinvoke is correct and then simply load the correct file manually). Lots of nugets already use this trick, e.g. System.Data.SQLite. This would be much easier for users, since most people use AnyCPU.

dotMorten commented 8 years ago

It also doubles the deployment size, and most people use C++ to write DirectX code so chances are things are already native code. Also most people who uses wpf and AnyCPU have the "prefer 32 bit" flag set (since its default in the project templates) and never need the 64bit assembly so why deploy it if it isn't needed. It should be an option

oysteinkrog commented 8 years ago

Hmm, it would be interesting to have some numbers, but I would have thought that most people use SharpDX for DirectX code when programming on .net/C#? But looking past the absolutes here; it would be very nice to support the AnyCPU scenario as good as possible, since I don't think there can be any doubt that lots of people use it. The current nugets make using AnyCPU impossible I think, and the big problem is that any nuget which does this basically forces an application into arch-specific builds. In my team I've worked to make the entire app AnyCPU and it works very well. I guess there is no reason there can't both a unified nuget and platform-specific nugets?

grokys commented 8 years ago

+1 this would be really useful for those folks that use SharpDX to do their rendering.

xaviergonz commented 8 years ago

+1 for AnyCPU, bearing in mind each dll seems to be < 100kb

LordBenjamin commented 7 years ago

+1 for AnyCPU nuget option.

I'm working on a project which needs to be able to run on old, low end machines, tablets, etc - these are often 32-bit.

It also needs to run 64-bit to take advantage of > 2GB process memory when doing certain tasks. These are simply disabled when a 32-bit platform is detected.

It would be great to have a single nuget dependency for both. The rendering code is C# / SharpDX based, so this would fit with the general approach nicely. "Prefer 32-bit" is certainly not checked on my build!

An extra 100kb is not an issue for me, the install is ~300MB.

I'd be willing to put some time into this if it would help.

LordBenjamin commented 7 years ago

Bump - any update on this? Is this repo actively maintained anymore? (I see no files have changed for 2 years)

weltkante commented 7 years ago

@LordBenjamin it's an old repository so its probably the same problem as over at clrmd - its from a time before they established a standard procedure for their github repos so it indeed may not be actively maintained until someone is made aware of it.

LordBenjamin commented 7 years ago

@weltkante Thanks for the info. Do you know who I should contact under the new procedure to check what's going on?

holance commented 7 years ago

You can use helix toolkit if you are using wpf+sharpdx combination. You can use it under x64 as well. https://github.com/helix-toolkit/helix-toolkit