[Nuget] Include Bepu1 and Bepu2 in one Project

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
felix.ri
Posts: 3
Joined: Tue Jul 07, 2020 10:26 am

[Nuget] Include Bepu1 and Bepu2 in one Project

Post 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!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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>
felix.ri
Posts: 3
Joined: Tue Jul 07, 2020 10:26 am

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

Post 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?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post by Norbo »

I'll definitely consider it, but could you elaborate more on your use case so I can understand the context better?
felix.ri
Posts: 3
Joined: Tue Jul 07, 2020 10:26 am

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

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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.
Post Reply