简体   繁体   English

如何统一使用.Net 4.6.1?

[英]how to use .Net 4.6.1 in unity?

I have 4 projects that call each other, final C# project passes array to unity engine. 我有4个相互调用的项目,最终的C#项目将数组传递给unity引擎。 This is all I need. 这就是我所需要的。 project hierarchy is as follows: c++ (for algorithm) -> wrapper CRL ->C# dll (to receive 'unsafe' code -> c# class in unity engine. I think it is not the most efficient way of doing that, but everything else failed. 项目层次结构如下: c ++(用于算法)->包装器CRL-> C#dll(在统一引擎中接收“不安全”代码-> c#类。我认为这不是最有效的方法,但其他所有方法失败了

I tried 2 things: 我尝试了两件事:

1) setting frameworks 4.6.1 .NET then everything works in visual studio but when I add it in unity it automatically changes framework 4.6.1 to 3.5 1)设置框架4.6.1 .NET,然后一切都可以在Visual Studio中运行,但是当我将其统一添加时,它将自动将框架4.6.1更改为3.5

2) setting frameworks to lower version (2.0) 2)将框架设置为较低版本(2.0)
then I get the following error: 然后我得到以下错误:

Severity Code Description Project File Line Suppression State Warning The primary reference " CppWrapper " could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Xml, 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. 严重性代码说明项目文件行抑制状态警告无法解析主要参考“ CppWrapper ”,因为它间接依赖于.NET Framework程序集“ System.Xml,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089”当前目标框架中的版本“ 4.0.0.0”比版本“ 2.0.0.0”更高。 OurFirstDL. OurFirstDL。

I set CppWrapper to 2.0 as well but error is the same. 我也将CppWrapper设置为2.0,但错误是相同的。

Is there solution for this? 有解决方案吗?

By the way, maybe there is the other way to do what I want. 顺便说一句,也许还有另一种方式可以做我想要的事情。 I just want to pull two arrays from c++ into unity engine. 我只想将两个数组从c ++拉入统一引擎。

Thank you! 谢谢!

you could use the assembly binding tool to figure out exactly what is going on. 您可以使用程序集绑定工具找出正在发生的事情。 Been a while since i used it ... Fusion logger. 自从我用了一段时间以来... Fusion logger。

Often when in these situations something will pop out. 在这种情况下,通常会弹出一些东西。 Maybe there is something specific on the cpp side that is causing the problem. 可能是cpp方面有某些特定问题导致此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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