How to compile VB.net in linux in monodevel? - vb.net

I have a 500 line code that I wrote in vb net when I had windows.
In the meantime, I switched to Ubuntu. I can do only vb.net. I tried mono develop but it is so painful because it says console.writeline is not a command, or application.commandlineargs is invalid.
I tried installing packages available for mono for those commands and system.console did not work even though the package was included.

Related

Global Assembly Cache - Assembly Install required

I am currently updating a VB.NET application with Visual Studio 2013 that possibly was originally created on VS2010 or VS2012.
This application uses a Network SQL Database
Everything goes fine up to the point of installing when just shows an error message. that says the Assembly 'Microsoft.VisualBasic.Shell.9.0' version 2.0.0.0
is required and then will not let me finish the installation.
The project has been exported using the Visual Basic tool [OneClick]
I have already checked the References list on the Project menu, and is not included there. Also not available to be added.
The project requires the Microsoft Framework 4.5, so it seems that the Shell v2.0.0.0 is pretty old...
Do you have any suggestions, this kept me scratching my head already quite a while...
I finally figured it out.
I am not too sure if this is the right solution or not but it worked for me. Hopefully this will help someone else.
It turn out to be a error with the framework I was compiling the project (v4.5),
I was trying to install it on a Windows 7 machine with a framework installed up to v4.0. I cant understand why this error message showed up instead of telling me the framework version required for the software was not installed.
But anyways, I changed the version on the compiler, build and export again. Another error pop up but it was because references to the DLL for the different framework version were not included in the project. After including them and set the value for "Copy to Local" to true, the installation worked like a charm.
So I got my program up and working.

Calling an x86 dll from a VS 2010/DotNet 4.0 x86 targeted app

I'm getting an 'AccessViolationException' 'Attempted to read or write protected memory' when calling a method in an x86 dll when running on an x64 platform (Windows 7). Everything works great on x86 platforms.
I've read many, many posts about similar problems but haven't been able to get my code to work.
I'm in the process of trying to make our old x86 app work happily on Windows 7 (x64) and Server 2008 R2 (x64). The app is an assortment of VB6 , VB.Net, C#, MicroFocus COBOL and C++. (We couldn't think of any other languages to throw in at the time). The DotNet code was originally written in Visual Studio 2003 for DotNet 1.1. I've ported the code up to Visual Studio 2010 and DotNet 4.0. I've set the target for all the projects to x86. When I call into un-managed 32 bit dll's I get the above error.
Our InstallShield setup routine is installing the x86 dll's into C:\Windows\sysWOW64 instead of C:\Windows\System32. This behavior seems correct. The dll's are some COBOL object code and runtime components linked together into a 'C Style' dll. I don't think the problem has to do with COBOL or the linking process as I also ported up a sample app from Code Project with a VB.Net WinForms app that calls a simple C++ dll, all targeted to x86. I get the same error there. I've also tried building a C++ command line app to call the dll. The Load Library succeeds. GetProcAddress succeeds. Calling the function pointer for the particular method fails. Our VB6 apps can call the dll's just fine when running on Windows 7 x64. I've also tried turning off UAC and setting the requestedExecutionLevel in the manifest to the highestAvailable. I've tried running as administrator.
Seems like this should work, but not sure what to try next. Any ideas?
On x64 .net programs will be run as 64-bit programs and cannot call 32bit-dlls.
Try compiling the application with target x86 instead of "Any Target". You can also force the
target of the built .exe with the .Net CorFlags.exe utility to run in 32bit-mode.
Of course your program will then run in the 32bit environment, especially it will only have a maximum of 2gb of RAM.
Good news,
We investigated DEP as a possible cause of the problem as we saw that even our VB6 code will fail when DEP is turned on. We noticed that the VB.Net code was failing in the same way as VB6 when DEP was on. Apparently our COBOL dll's do something that DEP isn't happy with. Unfortunately the DotNet assemblies don't seem to respect the operating system DEP setting, so you have to turn off DEP with using editbin.exe:
editbin.exe /nxnocompat:no
I still have to test it on our full application, but it looks like we have a solution!

IronPython 2.7/ 2.6 for .Net4 Install Error

I am gettting some really annoying errors while attempting to install IronPython so I can work with .Net4 assemblies.
I have tried both the .Net4 compatible installer versions of IronPython and both give me an error. The 2.7 one says it has had a problem installing assembly error code 2908. The 2.6 for .Net4 installer just says it has encountered an error and rolls back.
I have IronPython2.6 installed and working fine. But I need the .Net4 upgrade, I am running Win7 x64. Think maybe the OS configuration might be at fault? I realise this isn't a straight programming question, but I was hoping some of the SO community might be able to shed some light on this one, where my Google bashing has not.
If you don't need it to be installed, you can use the .zip package to get the files. The only thing the installer really does is add the assemblies to the GAC.

How to compile Mono with vb.net support

I've downloaded latest source from mono project, compiled it and everything works (c# projects, mod_mono, xsp) except vb.net. Vbnc, mono's vb.net compiler does not exist after compiling mono from source.
This is on CentOS 5, on Ubuntu 10.04 I installed mono packages via apt-get and vb.net just works.
What am I missing, or how to get vb.net support?
Mono's VB.Net support is in a separate module.
Either download the 'mono-basic' tarball:
http://ftp.novell.com/pub/mono/sources-stable/
or get it directly from SVN:
http://anonsvn.mono-project.com/viewvc/trunk/mono-basic/
or you can simply copy over what you need from a working system, like vbnc.exe and Microsoft.VisualBasic.dll.
All information about VB.NET on Mono is available at http://www.mono-project.com/Language_BASIC
Precompiled VB.NET assemblies can just be run with Mono.
The Mono VB.NET compiler is called vbnc.
If you need further help, can you please specify what exactly doesn't work? Does the compiler executable not exist, will VB.NET programs not run, or are you referring to MonoDevelop support?
(If the latter, make sure you have the latest MonoDevelop...)

MonoDevelop: error VBNC99999

hope someone is using Mono & monodevelop...
i'm getting the following error when i try to compile an ASP.NET apps ported from vs.net 2008
Error VBNC99999: Unexpected error: The classes in the module cannot be loaded. (VBNC99999)
This is the only error i get.
I'm using 4 external assembly / dll
AjaxControlToolkit.dll
FusionCharts.dll
MySql.Data.dll
PostBackRitalin.dll
I've added the dll in bin directory, then i've referenced it.
I'm using Mono, because on my "old" computer (acer aspire t2300 buyed in 2007) run with linux & with monodevelop very well.
With windows, visual studio is reeeeeeally slow.. so i decide to pass to mono..
Can somenone know something about that error ?
Thank you very much. Regards !
I can guess a few possible reasons, though it's hard to be sure without more info.
The Mono VB.NET compiler is only a VB8 compiler (VS2005), so if you're using VB9 features that might explain the problem.
One of the libraries you're using might be a mixed-mode binary, and contain native Windows code.
You might have found a bug in the VB compiler. If you think this is the case, you should file a bug report.
Beware that Mono's VB.NET compiler is nowhere near as actively developed and tested as the C# one, and MonoDevelop doesn't have code completion or refactoring for VB either. I generally recommend that VB devs compile on Windows and copy the binaries over to Linux, or learn C#...