找不到导入的DLL的类型或名称空间 [英] Unable to find type or namespace of imported DLL

查看:131
本文介绍了找不到导入的DLL的类型或名称空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从此下载了"smilenet-1.2.1-win64-academic"库页面,然后在我的Unity项目中导入了smileNET.dll.然后,我重新启动了Visual Studio,当我尝试使用该库时,它给了我一个错误,即找不到类型或名称空间.我按照文档文件Hello.cs中的指示尝试了using Smile;using smileNET;,但是那没起效.我尝试了64位版本以及32位版本.我的统一版本是2018.1.8f1 64bit

I downloaded the "smilenet-1.2.1-win64-academic" library from this page and imported the smileNET.dll in my Unity project. Then I restarted my visual studio, and when I tried to use the library, it gave me an error that the type or namespace could not be found. I tried using Smile; and using smileNET; as indicated in their documentation file Hello.cs but it did not work. I tried 64 bit version as well as 32 bit one. My unity version is 2018.1.8f1 64bit

当我检查下载的dll时,它说当我的VS2017运行版本4.7.03056时,> NET版本是v4.0.30319,这可能是问题吗?

When I inspected the downloaded dll, it said that the >NET version is v4.0.30319 while my VS2017 is running version 4.7.03056, could that be a problem?

我尝试过的各种事情:

  1. 我还尝试了手动添加引用.添加引用的选项没有出现,因此我单击了Project> Referneces> Analyzers,如下所示,然后在顶部菜单中单击了Project>Add References,然后添加了smileNET.dll文件.这样做可以(暂时)修复错误.当我关闭VS时,它询问我是否要将更改保存到Chem-o-Crypt.sln Assesmbly-CSharp*,所以我说是"(尽管我怀疑它是否确实保存了).但是,当我重新启动Visual Studio时,我发现该引用已消失,并且错误再次弹出. h:/
  1. I also tried manually adding references. The option to add references was not appearing, so I clicked on Project>Referneces>Analyzers as shown below and then in the top menu clicked on Project>Add References and then added the smileNET.dll file. Doing so fixed the error (temporarily). When I closed my VS it asked me if I want to save the changes to Chem-o-Crypt.sln Assesmbly-CSharp*, so I said yes (although I doubt if it was really saved). But when I restarted my Visual Studio, I found that the reference was gone, and error popped up again. meh :/

  1. 还尝试启用不安全代码的编译(以防万一),如Unity 文档,但也不起作用.
  1. Also tried enabling compiling of unsafe code (just in case) as shown in the Unity documentation, but did not work either.

  1. 我有另一个文件夹(Chem-o-Crypt/Assets/bayesserver-8.3/DotNet/Standard20/),其中包含其他几个运行良好的dll,因此我将dll粘贴到了那里,但它不起作用.
  2. 我确实尝试过在Chem-o-Crypt/Chem-o-Crypt/PluginsChem-o-Crypt/AssetsChem-o-Crypt/Assets/Plugins中添加该dll,但不是这样,但这似乎是坚定的,无法正常工作.
  3. Chem-o-Crypt\Assets\Plugins\x64中复制了dll的64位版本,在Chem-o-Crypt\Assets\Plugins\x86中复制了32位的版本,均不起作用.
  4. 将dll复制到Unity编辑器的根目录(例如C:\ Program Files \ Unity \ Editor)
  5. 此人与我的错误相同.跳到15:21的时间,但是我无法使用他的解决方案,因为我的项目资源管理器中的内容显示方式有所不同.基本上,dll不会像在他那里那样显示在那儿.
  1. I have another folder (Chem-o-Crypt/Assets/bayesserver-8.3/DotNet/Standard20/) which contains several other dlls that are working fine, so I pasted my dll there and it did not work.
  2. I have literally tried adding this dll in Chem-o-Crypt/, Chem-o-Crypt/Plugins, Chem-o-Crypt/Assets, Chem-o-Crypt/Assets/Plugins and what not, but it seems to be adamant and not working.
  3. Copied the 64 bit version of dll in Chem-o-Crypt\Assets\Plugins\x64 and 32 bit version in Chem-o-Crypt\Assets\Plugins\x86 which did not work either.
  4. Copied the dll at the root level of the Unity editor (e.g. C:\Program Files\Unity\Editor)
  5. This person was getting the same error as mine. Skip to time 15:21 to see, but I am not able to use his solution as the things in my project explorer are appearing differently. Basically the dll is not showing up there, just like it did for him.

推荐答案

我下载了dll,很遗憾,这是一个混合程序集,请参见图片,Unity不支持.

I download the dll, unfortunately this is a mixed assembly, see the picture, which is not supported by Unity.

那么一些解决方法可以是:

Then some workaround can be:

使用smileNET.dll创建另一个C#程序并与Unity程序通信.

Create another C# program using smileNET.dll and communicate with Unity program.

这篇关于找不到导入的DLL的类型或名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆