Dewera / Lunar

A lightweight native DLL mapping library that supports mapping directly from memory
MIT License
584 stars 102 forks source link

System.ArgumentException: An item with the same key has already been added. Key: VCRUNTIME140.dll #14

Closed shiversoftdev closed 3 years ago

shiversoftdev commented 3 years ago

at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) at Lunar.Remote.ProcessContext.Refresh() in Lunar-master\Lunar\Remote\ProcessContext.cs:line 165 at Lunar.LibraryMapper.LoadDependencies() in Lunar-master\Lunar\LibraryMapper.cs:line 575 at Lunar.LibraryMapper.MapLibrary() in Lunar-master\Lunar\LibraryMapper.cs:line 127

image

Running as a .net 5 console app.

Dewera commented 3 years ago

Interesting issue, thanks for reporting this. Could you provide the DLL you are encountering this with?

If you don't want to upload the DLL here you can add me on Discord (Quin#4576) and provide it there.

shiversoftdev commented 3 years ago

I'm sorry, I cant provide the DLL. It was not static linked though, which I've been told may contribute to the problem.

Dewera commented 3 years ago

Not being statically linked won't be the issue.

If you don't want to provide me with the DLL then I'm going to have some additional information as this is not very easy to debug without being able to replicate the issue.

My guess is that the DLL and process both have a dependency on a DLL, however, one of them is using a SxS version of said DLL, hence 2 DLLs are loaded in the process with the same name but they are different versions (and need to stay isolated for obvious reasons.)

To verify this could you please do the following (and report back the information I'm requesting)

Dewera commented 3 years ago

Fixed in 3d368db