Bug 29688 - 4.0 update on Ubuntu cannot find VisualBasic assembly
Summary: 4.0 update on Ubuntu cannot find VisualBasic assembly
Status: CLOSED FIXED
Alias: None
Product: Installers
Classification: Mono
Component: General ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Rodrigo Kumpera
URL:
Depends on:
Blocks:
 
Reported: 2015-05-03 21:07 UTC by Gary Briggs
Modified: 2015-05-07 11:20 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
CLOSED FIXED

Description Gary Briggs 2015-05-03 21:07:46 UTC
[Text copied from my Stackoverflow question, after verifying someone else in the IRC channel is manifesting it]
 
I have just upgraded my 64-bit ubuntu 14.04.2 LTS to the latest mono. I followed the instructions on the mono-project install page a few months ago, and before today had been using mono 3 without issue. Today I patched my system, 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. Running with -v doesn't provide additional information about "... one of its dependencies", this is the first error that shows.

To reproduce:

* Update ubuntu to current [as of 2015-05-03] packages per http://www.mono-project.com/docs/getting-started/install/linux/#usage [this happens on my 14.04 and 14.10 boxes]
* Use monodevelop to create "hello, world" VB.net program
* Click build - works fine
* Click run - exact error above.
Comment 1 Jo Shields 2015-05-04 09:20:44 UTC
https://github.com/mono/mono-basic/pull/8 - will fix on Tuesday
Comment 2 Gary Briggs 2015-05-05 21:18:28 UTC
Also, it turns out that statically bundling the binaries serves as a short-term workaround to at least allow execution:

$ mkbundle --deps --static bin/Debug/RTAM_Basic_Pre.exe -o bundle/Debug/RTAM_Basic_Pre.exe
OS is: Linux
Note that statically linking the LGPL Mono runtime has more licensing restrictions than dynamically linking.
See http://www.mono-project.com/Licensing for details on licensing.
Sources: 1 Auto-dependencies: True
   embedding: /home/gbriggs/src/rtam/bin/Release/RTAM_Basic_Pre.exe
 config from: /home/gbriggs/src/rtam/bin/Release/RTAM_Basic_Pre.exe.config
   embedding: /usr/lib/mono/4.5/mscorlib.dll
   embedding: /usr/lib/mono/gac/Microsoft.VisualBasic/11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
   embedding: /usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll
   embedding: /usr/lib/mono/gac/Mono.Security/4.0.0.0__0738eb9f132ed756/Mono.Security.dll
   embedding: /usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
   embedding: /usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll
   embedding: /usr/lib/mono/gac/System.Security/4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
   embedding: /usr/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
 config from: /usr/lib/mono/gac/System.Windows.Forms/4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.config
   embedding: /usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
 config from: /usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.config
   embedding: /usr/lib/mono/gac/Mono.WebBrowser/4.0.0.0__0738eb9f132ed756/Mono.WebBrowser.dll
 config from: /usr/lib/mono/gac/Mono.WebBrowser/4.0.0.0__0738eb9f132ed756/Mono.WebBrowser.dll.config
   embedding: /usr/lib/mono/gac/Mono.Posix/4.0.0.0__0738eb9f132ed756/Mono.Posix.dll
   embedding: /usr/lib/mono/gac/System.Runtime.Serialization.Formatters.Soap/4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Serialization.Formatters.Soap.dll
   embedding: /usr/lib/mono/gac/Accessibility/4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
   embedding: /usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll
 config from: /usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll.config
   embedding: /usr/lib/mono/gac/Mono.Data.Tds/4.0.0.0__0738eb9f132ed756/Mono.Data.Tds.dll
   embedding: /usr/lib/mono/gac/System.Transactions/4.0.0.0__b77a5c561934e089/System.Transactions.dll
   embedding: /usr/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
Compiling:
as -o temp.o temp.s 
cc -o bundle/Release/RTAM_Basic_Pre.exe -Wall `pkg-config --cflags mono-2` temp.c  `pkg-config --libs-only-L mono-2` -Wl,-Bstatic -lmono-2.0 -Wl,-Bdynamic `pkg-config --libs-only-l mono-2 | sed -e "s/\-lmono-2.0 //"` temp.o
Done
$ ./bundle/Debug/RTAM_Basic_Pre.exe 
usage: RTAM_Basic_Pre <scenario_file>
$
Comment 3 Gary Briggs 2015-05-07 11:20:35 UTC
Confirmed fixed in new Ubuntu package, closing.