Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.NET Not working on Ubuntu 10.04 With Mono

When i run program Error Shows...

Could not load file or assembly 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Description: HTTP 500. Error processing request.

Stack Trace:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. File name: 'Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at mysite.login.loginAuthentication (System.String loginId, System.String pass) [0x00000] in :0 at mysite.login.Page_Transfer (System.Object sender, System.EventArgs e) [0x00000] in :0 at System.Web.UI.WebControls.Button.OnClick (System.EventArgs e) [0x00000] in :0 at System.Web.UI.WebControls.Button.RaisePostBackEvent (System.String eventArgument) [0x00000] in :0 at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (System.String eventArgument) [0x00000] in :0 at System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, System.String eventArgument) [0x00000] in :0 at System.Web.UI.Page.RaisePostBackEvents () [0x00000] in :0 at System.Web.UI.Page.ProcessRaiseEvents () [0x00000] in :0 at System.Web.UI.Page.InternalProcessRequest () [0x00000] in :0 at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in :0

Version information: Mono Runtime Version: 2.10.2 (tarball Mon Apr 9 10:20:24 PKT 2012); ASP.NET Version: 2.0.50727.1433

like image 877
muhammadanish Avatar asked Apr 09 '12 10:04

muhammadanish


3 Answers

In fact you should install mono-vbnc. By default, Ubuntu does not install that package.

like image 138
Lex Li Avatar answered Oct 02 '22 20:10

Lex Li


The Microsoft.VisualBasic DLL contains some VB.NET-specific functionality, such as Asc and IIf that is not included with Mono by default.

On Ubuntu, you should be able to add the required dependencies by installing the libmono-microsoft-visualbasic8.0-cil package.

Additionally, if you're using Visual Studio.NET 2010 SP1 or above and your project is (mostly) a library, it may be worth looking into Portable Class Libraries as well.

I also recall reading something about a VS.NET option to embed code from Microsoft.VisualBasic into the IL directly to avoid the dependency, but I can't find anything concrete about that right now...

like image 25
mdb Avatar answered Oct 02 '22 21:10

mdb


You need to install the VB runtime on your Ubuntu machine.

I've never used Ubuntu, but I believe the package is named libmono-microsoft-visualbasic8.0-cil.

like image 38
Rolf Bjarne Kvinge Avatar answered Oct 02 '22 20:10

Rolf Bjarne Kvinge