我想问一下 unity 添加 DLL 为什么会失效

时间蜕变 2016-11-08 05:45:17
我将DLL 放入到 unity Assert/Plugins/ 文件夹下面了, 添加引用的时候 弹出警告

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3258: The primary reference "CLRDLL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3258: The primary reference "CLRDLL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3258: The primary reference "CLRDLL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3258: The primary reference "CLRDLL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "3.5.0.0" in the current target framework.

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3258: The primary reference "CLRDLL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3268: The primary reference "CLRDLL" could not be resolved because it has an indirect dependency on the framework assembly "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "CLRDLL" or retarget your application to a framework version which contains "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

...全文
809 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
时间蜕变 2016-11-14
  • 打赏
  • 举报
回复
引用 8 楼 zq1564171310 的回复:
你用的unity什么版本?
Unity 5.4.1f1 (64-bit) 应该算最新版本了吧
zq1564171310 2016-11-11
  • 打赏
  • 举报
回复
你用的unity什么版本?
时间蜕变 2016-11-11
  • 打赏
  • 举报
回复
引用 5 楼 zq1564171310 的回复:
在解决方案里面,选中项目,右键属性,会有target framework
谢谢你哈~
zq1564171310 2016-11-09
  • 打赏
  • 举报
回复
缺少依赖库,你的dll的目标framework是哪个版本?你现在的framework哪个版本?确认下看看
时间蜕变 2016-11-09
  • 打赏
  • 举报
回复
引用 5 楼 zq1564171310 的回复:
在解决方案里面,选中项目,右键属性,会有target framework
UNITY本身的版本是v3.5 4.0直接警告了 但是 warning MSB3258: The primary reference "DLLLLLLLL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. 这个问题一直没解决了
zq1564171310 2016-11-09
  • 打赏
  • 举报
回复
在解决方案里面,选中项目,右键属性,会有target framework
时间蜕变 2016-11-09
  • 打赏
  • 举报
回复
引用 3 楼 zq1564171310 的回复:
把dll打包成framework4.0试试,以前我遇到过,改了dll的framework4.0似乎就没事了
怎么打包成4.0版本啊。。是新建个项目吗?
zq1564171310 2016-11-09
  • 打赏
  • 举报
回复
把dll打包成framework4.0试试,以前我遇到过,改了dll的framework4.0似乎就没事了
时间蜕变 2016-11-09
  • 打赏
  • 举报
回复
引用 1 楼 zq1564171310 的回复:
缺少依赖库,你的dll的目标framework是哪个版本?你现在的framework哪个版本?确认下看看
Unity的 FrameWork 和我DLL的FrameWork 都改成 v3.5了 还是有问题
本课程主要是针对ILRuntime设计一个独立的脚本热更新框,框架的优势:1.将代码热更脱离Assetbundle资源热更,独立的部分更适用于各种不同的框架。2.加快项目的逻辑更新,bug修复.(后期修bug,多数情况下并不用动到资源,只需要更新脚本代码,无需重走资源打包发布流程,大大提升效率)3.提供热更模式和正常开发模式的快速切换接口,可以让队友像平常一样去开发.4.不依赖市面上的任何AB框架,完全兼容市面上各种不同的AB框架.5.重点:希望通过它,帮助你学习、了解ILRuntime真正在项目中的应用.框架的将提供以下这些接口,这些接口将从0开始,在Unity里将C#脚本编译成dll,然后将dll放到服务器上,再将dll下载下来,进行加载,到最后从Unity主工程调用热更新的代码逻辑.1.Create hotfixdll接口将热更部分的代码 编译成dll生成dll版本配置(MD5)2.更新对比接口本地跟服务器的dll进行版本对比3.下载热更dll下载dll本身的文件下载版本记录文件4.加载热更dll加载dll实例化:AppDomain初始化:注册跨域继承适配器注册委托适配器LitJson重定向调用性能优化(CLR绑定功能)调用热更接口Hotfix.HotfixApplication.Main 进入热更逻辑5.ILMonoBehaviour用于监听组件的生命周期,实际是桥接(调用)热更的逻辑AwakeStartEnableUpdateLateUpdate.......6.添加其他常用的库DOTweenLitJsonSpineGoogle.ProtobufTextAnimation可以根据上面的方式,自行添加依赖的库... 

2,526

社区成员

发帖
与我相关
我的任务
社区描述
Unity3D相关内容讨论专区
游戏unity 技术论坛(原bbs)
社区管理员
  • Unity3D
  • 芝麻粒儿
  • 「已注销」
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

Unity3D社区公告:

  1. 社区致力于解决各种Unity3D相关的“疑难杂症”。
  2. 社区不允许发布与Unity3D或相关技术无关内容。
  3. 社区版主邀请各位一道为打造优秀社区不懈努力。

试试用AI创作助手写篇文章吧