简体   繁体   中英

Unity error CS1705: which has a higher version than referenced assembly

I have a .dll that I made with .NET 6 and I want to use it as a dependency on an Unity project on Linux and using mono as compiler. The problem is that when Unity loads the .dll it throws this error:

error CS1705: Assembly 'DominoEngine' with identity 'DominoEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I've seen people with similar issues around but I can't get to a solution for this

I recommend you build the DLL in a .Net Standard 2.0 project. In your visual studio solution, create a new Project and choose .Net Standard 2.0 Library as the project type. Move your code into there. You can still have a 6.0 EXE project that references that assembly, and then you can also use that assembly anywhere including Unity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM