找到你要的答案

Q:Mono cannot find dll that seems to exist

Q:单找不到DLL,似乎存在

I have just upgraded my 64-bit ubuntu 14.04.2 LTS to the latest mono. I followed the instructions on this page a few months ago, and before today had been using mono 3 without issue. Today I upgraded, which moved me to mono 4.0.1:

$ mono --version
Mono JIT compiler version 4.0.1 (tarball Tue Apr 28 11:47:58 UTC 2015)

I have successfully compiled this program using monodevelop, but the exact same issue manifests with a VS2013-compiled binary [newlines exactly as they appear in the output]:

$ file RTAM_Basic_Pre.exe
RTAM_Basic_Pre.exe: PE32 executable (console) Intel 80386 Mono/.Net Assembly, for MS Windows
$ mono RTAM_Basic_Pre.exe

Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Thing is, I'm really quite sure that file exists:

$ pwd
/usr/lib/mono/gac/Microsoft.VisualBasic/11.0.0.0__b03f5f7f11d50a3a
$ ls -l
-rw-r--r-- 1 root root 350720 Apr 27 12:00 Microsoft.VisualBasic.dll
$ file Microsoft.VisualBasic.dll                                 
Microsoft.VisualBasic.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows

It's possible that the error is the "... or one of its depedencies", but it's not clear to me how actually diagnose what's happening.

我刚刚升级了我的64位14.04.2 LTS Ubuntu最新单。几个月前,我遵循了这一页上的说明,在今天之前一直使用单3没有问题。今天我升级了,这让我对单4.0.1:

$ mono --version
Mono JIT compiler version 4.0.1 (tarball Tue Apr 28 11:47:58 UTC 2015)

我已经成功编译这个程序使用MonoDevelop,但同样的问题体现了VS2013编译的二进制[换行符完全一样出现在输出]:

$ file RTAM_Basic_Pre.exe
RTAM_Basic_Pre.exe: PE32 executable (console) Intel 80386 Mono/.Net Assembly, for MS Windows
$ mono RTAM_Basic_Pre.exe

Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'Microsoft.VisualBasic, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

事情是,我真的很确定文件存在:

$ pwd
/usr/lib/mono/gac/Microsoft.VisualBasic/11.0.0.0__b03f5f7f11d50a3a
$ ls -l
-rw-r--r-- 1 root root 350720 Apr 27 12:00 Microsoft.VisualBasic.dll
$ file Microsoft.VisualBasic.dll                                 
Microsoft.VisualBasic.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows

错误可能是…或它的一个depedencies”,但我并不清楚如何诊断发生了什么。

answer1: 回答1:

Through tracing a simple VB helloworld program with MONO_LOG_LEVEL=debug MONO_LOG_MASK=asm I found the following:

Mono: The request to load the assembly Microsoft.VisualBasic v11.0.0.0 was remapped to v10.0.0.0

Turns out the v11.0.0.0 version number is actually incorrect, this pull request should fix it: https://github.com/mono/mono-basic/pull/8

通过跟踪一个mono_log_level =调试mono_log_mask = ASM我发现以下简单的VB的HelloWorld程序:

单:加载组件microsoft.visualbasic v11.0.0.0请求映射到v10.0.0.0

原来v11.0.0.0版本号实际上是不正确的,这将要求改正:https://github.com/mono/mono-basic/pull/8

answer2: 回答2:

The first thing I would try in a situation like this is to see if the system can fix the dependencies itself. The first few steps on the installation guide should have set you up with the needed repositories. In the shell, try executing:

sudo apt-get install -f mono-complete

The '-f' flag should tell the system to make sure the dependencies are there.

I hope this can be of help! Apologies if that doesn't turn out to be the case. 030

在这种情况下,我首先要尝试的是看看系统是否能够修复依赖本身。安装指南的最初几步应该设置您需要的存储库。在shell中,尝试执行:

sudo apt-get install -f mono-complete

“F”标志应该告诉系统以确保依赖关系存在。

希望这能对你有所帮助!道歉如果不是事实证明的话。030

vb.net  ubuntu  mono