VB.NET programming in Ubuntu

31,376

Solution 1

Use MonoDevelop but beware of the quirks of X-platform .NET development

First, install mono by either finding it in the Software Centre or typing

sudo apt-get install monodevelop mono-vbnc

MonoDevelop is pretty equivalent to Visual Studio Express the major differences being:

  • MonoDevelop doesn't support WPF (Windows Presentation Foundation) but that shouldn't matter much as Microsoft has plans to kill WPF with the arrival of Windows 8.

  • Verify that the correct .NET framework target is being used. After creating a solution, right click on the project and goto Options->Build->General. Not much different from targeting a specific version of .NET on Windows.

Aside from those issues, I haven't really found anything missing that I can't live without.

The only other issue (non mono related) that may come back to bite you is the classic line ending problem. *nix still uses LF and Windows still uses CRLF for line endings so, when you transfer your source files back and fourth between Windows/*nix. AFIAK, MonoDevelop saves source files in UTF-8 by default but VS saves source files in Windows ASCII (with windows-1252 latin ASCII with windows specific line endings). If you receive source files that were created using Visual Studio you may need to convert the format to get it to work in *nix.

As you can see, x-platform .NET development can be a little challenging at first but IMHO, it's worth it. I like MonoDevelop's non-cluttered interface (the visual effects in VS just get in the way most of the time), it loads in a fraction of the time that VS does (useful if you don't typically leave your IDE open all the time), it takes up a fraction of the space with no extra unnecessary addons (VS is really obnoxious about this).

Installing it was easy as sudo apt-get install monodevelop. Also, popular tools like NUnit (for unit testing) have been ported over to and work flawlessly in *nix. The Windows version of MonoDevelop kinda sucks (or at least it did last time I tried it).

Update:

To get VB code to compile you'll also need to install the VB compiler module:

sudo apt-get install mono-vbnc

I also updated this answer to remove some of the problems that are no longer relevant.

Solution 2

It really depends on your syllabus.

Mono does have VB.NET language support but the framework is somewhat different in places and I'd predict that as much of your work will be about the .NET framework as it is the core language. It might not be as it sounds like it's at a fairly elemental level (no offence intended!)

Even if the work is just language-orientated, as you say, you're not going to get the silly Visual Studio meta project files. You could have problems opening things and (again, as you say) you'll definitely have problems getting things to other (perhaps less competent) people.

With this the case, and you still want Ubuntu as your main system, VirtualBox sounds like the best way of remaining compatible with your coursework. It's much more convenient than dual-booting but it requires you have a more-than-average computer for a good experience (especially with something stodgy like VS.NET).

Or beat your teacher into learning and teaching Python. By far a simpler and better language.

Share:
31,376
Code.Decode
Author by

Code.Decode

Updated on September 17, 2022

Comments

  • Code.Decode
    Code.Decode over 1 year

    I have just started at sixth form college, and I'm going to take a Computing A-level. I have been informed all the programming in the first year is in VB.NET on Windows (I believe you are allowed more freedom in the second year...)

    I do have a Windows XP partition and you can download Visual Basic Express Edition for free, however I would like to know to what extent am I likely to be able to use Ubuntu (Mono or anything else) for my studies? Can anyone give me any pointers of where to start?

    Realistically if this is to work I need to be able to use the same files/projects/whatever on both Ubuntu and Windows - so I can work from Windows machines at college, and more importantly so teachers can look at and mark my work! (I don't really want to make a point of asking my teacher about my Ubuntu use, I'd prefer to blend in and be a normal student...)

    • Bilal Akhtar
      Bilal Akhtar almost 14 years
      Check out Mono and MonoDevelop mono-project.com .
    • TheXed
      TheXed over 13 years
      I just want to say I loved developing with VB.net, and it was one of my favorite languages to learn. Unfortunately, by the time I started learning VB.net I had already taken classes in C++ and Java, and throughly hated programming. I am glad to see that schools are moving towards starting with VB as a primer.
    • NoBugs
      NoBugs over 11 years
      Interesting. I'm curious, how is VB.net better than C# (or Java)?
  • youri
    youri almost 14 years
    +1 for Virtual Box + -1 for Python as a collage language = 0
  • dv3500ea
    dv3500ea almost 14 years
    What's wrong with Python? Its definately a lot better than VB.
  • Javier Rivera
    Javier Rivera almost 14 years
    Oh +1 for Virtual Box (it's VB like Visual Basic), +100 for python as a learning language.
  • Code.Decode
    Code.Decode almost 14 years
    I'm getting an error message: Error: Visual Basict .NET compiler not found (Mono 2.4.4) (Testing) (this is literally just trying to run the default preset Hello World VB.NET console application)
  • Evan Plaice
    Evan Plaice over 13 years
    @fluteflute The compiler isn't found because it isn't installed. Apparently, The VB compiler for .NET isn't installed in Ubuntu by default like it is for C#. Just 'sudo apt-get install mono-vbnc' to install it.
  • ayan4m1
    ayan4m1 over 13 years
    Python has esoteric syntax and relies on indents to determine what get executed when. In my opinion it's better than VB, but not as a learning language.
  • NoBugs
    NoBugs over 11 years
    You are able to open Visual Studio VB.net/C# projects in Monodevelop, it compiles and runs fine, even GUI window forms work. I would recommend starting it with Visual Studio if possible, if you're working on MS Windows form applications. Mono doesn't have an easy 'design mode' to design these. (yet?)
  • Evan Plaice
    Evan Plaice over 11 years
    @NoBugs Mono can handle Winforms GUIs? I always thought they would stick to just GTK#. I guess it's time to update this answer.
  • NoBugs
    NoBugs over 11 years
    Yes, I've run two Windows-VS projects in Mono without problems. I think you may need to add an import to Monodevelop though? Native GTK is probably what most Linux C# apps use.
  • matandked
    matandked over 8 years
    It seems that currently it is not possible to write any VB .NET programs in Monodevelop (at least under Linux). When you create new solution - even the simplest default console application - it is not possible to load such project ("Project does not support framework"). Changing framework manually to 4.0 does not help. I reported that in BugZilla (bugzilla.xamarin.com/show_bug.cgi?id=38508) and as I can see there's a problem with framework under Mac too (forums.xamarin.com/discussion/28329/…).