Page 1 of 1

[Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Tue Jul 07, 2020 11:08 am
by felix.ri
Hi,

I want to include both versions of the Physics Simulation into my C# Project.
I am also using the Nuget version of both.

When the binaries gets copied to the output directory, they each overwrite each other on Windows, because the only difference is the Upper-/ Lowercase in BEPUUtilities.dll and BepuUtilities.dll. (probably other dlls, too)

What is the recommended way of dealing with this issue?

Thanks!

Re: [Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Tue Jul 07, 2020 5:49 pm
by Norbo
Unfortunately that's an oversight. I didn't really think about using both in one project, so unless there's some automagic nuget stuff for handling collisions in dependencies that I'm unaware of, one easy option is to pull down one or both as source and add a project reference, and then modify the output assembly name in the csproj to avoid the collision:

Code: Select all

  <PropertyGroup>
...
    <AssemblyName>Toot</AssemblyName>
...
  </PropertyGroup>

Re: [Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Wed Jul 08, 2020 9:04 am
by felix.ri
We wanted to use the nuget packet, so that no source needs to get pulled and compiled by us.

Another problem is, that the Assemblies are not signed and we're using a signed application.
We tried to use Brutal.Dev.StrongNameSigner, but ran into problems with multiple dependencies to BEPU: every time, bepuutilities was used, the signer created a new, different signed dll.

Could you sign the dlls in the nuget packet?

Re: [Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Wed Jul 08, 2020 5:37 pm
by Norbo
I'll definitely consider it, but could you elaborate more on your use case so I can understand the context better?

Re: [Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Wed Jul 15, 2020 8:17 am
by felix.ri
We need to strongly sign our application. That means, that we can only reference strongly-named assemblies.
We have multiple projects, that reference bepu. The strong name signer creates a strong name for each one. (It can't detect, that we are dynamically loading dlls at runtime with no project reference)
The runtime loads the first module and with it Bepu. When the second module with a bepu reference gets loaded, it can't bind to the already loaded dll, because of public key mismatch.

My workaround atm is this:
I pulled the nuget packets and strongly signed them manually. That means, that every time you publish an update, I need to manually get the dll and sign it again.

Re: [Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Wed Jul 15, 2020 5:34 pm
by Norbo
Could you explain what you're deploying to that requires strong naming? I ask primarily because of this issue.

Also, could you elaborate on the usage of both bepuphysics1 and bepuphysics2 in one project?

Re: [Nuget] Include Bepu1 and Bepu2 in one Project

Posted: Wed Jul 15, 2020 5:53 pm
by Norbo
A strongnamed bepuphysics2 2.3.0-beta2 will be up after github actions finishes with it. I don't plan to make one for bepuphysics1 since it's frozen and won't be receiving updates anyway.