Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by drizztdourden_ · Mar 02 at 06:36 AM · dll

Two libraries with the same libraries but different version of it

Hi,

I've been banging my head on my desk for 3 days straight trying to make this work but I have to submit and ask for help at this point as I have no more ideas.

The situtation.

I'm trying to use "ImageSharp" to draw and create images and produce a png that's going to be mainly for debugging purpose for now. (Basically just drawing the debug version of a procedurally generated map)

ImageSharp has 3 libraries I need.

It was working just fine in my side project to code the generator in vscode (outside of unity) but once I integrated evreything in unity, ImageSharp return an error saying "System.Runtime.CompilerServices.Unsafe" reference is the wrong version.

Problem is that 2 of the libraries use a version of unsafe that is different from the third. It was managed in vscode automatically and worked just fine but unity doesn't like it and it seems to conflict with some unity librairies. (I'm not too sure if it's still relevant but I've seen post on the forum about this)

What I've tried

So I have tried a lot of stuff over the last few days but here's the gist of what I've tried:
- Installing ImageSharp through NugetForUnity but I basically got the same thing.
- Another nuget manager from someone internal at unity but only a few packages were available (Including unsafe and imagesharp) but only the main imageSharp was there since the other two are preview packages
- Compile every .dll, including both imageSharp(s) and unsafe both version. Create two folder in plugin with their respective dll
- Tried to create an assembly reference for those imageSharp dll so they could point to their respective dll
- Re-organize my whole project in sub-section with assembly, so the assembly that needs imageSharp could reference it. However, it was requiring that I override the reference, which seems to make it worse.

They all failed and I'm not sure if I was close to the solution at some point or not.

Current Situation

I have this right now:
- ImageSharp.dll
- ImageSharp.Font.dll
- ImageSharp.Drawing.dll
- System.Runtime.CompilerServices.Unsafe_4.0.6.0.dll (font)
- System.Runtime.CompilerServices.Unsafe_5.0.0.0.dll (base + drawing)


How do I organise this so they can both use they're own dll?

One thing I want to make clear. If I delete one of the dll, the errors for the other dll go away as they now have the right one, but other is missing it's dll and vice-versa. So I know they'll work If I just manage to force them to use the right one.

Thanks for anyone who can help clean this up for me.


Edit: I don't know if it's just me but actually using the editor for post is not very intuitive. I needed to add "br" tag everything just so my text could breathe a litle.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xxmariofer · Mar 02 at 02:54 PM 0
Share

I once encounter a similar issue, I tried using this repository, but never managed to make it work but consider giving it a try

https://github.com/DashW/UnityExternAlias

avatar image drizztdourden_ xxmariofer · Mar 03 at 09:50 PM 0
Share

That script implies that I have control over the script itself but I have the dll so I can’t modify them to specifie the alias.

If these were my scripts, I’d be using one library and that’d be it. :)

How did you end ip solving solving yours?

avatar image xxmariofer drizztdourden_ · Mar 04 at 10:02 AM 0
Share

The alias is ment for that use case, in which you have 2 dlls that you can edit, wrapping both dlls in 'alias' so you could specify the alias from the script to tell which dll use. It ended up being fairly easy, I decompiled the dll, saw that for any reason the library creator compiled a third party dll into his own dll, but I manage to found the original unmodified version of the library

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

176 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Editor crashes when loading managed Plug-in (external DLL) 1 Answer

Try to load a DLL and I got System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. 0 Answers

How to use DLLs 1 Answer

What is csc.rsp file and How can I add it to Unity assest? 1 Answer

export unity game as .net framework dll 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges