1

I'm running Ubuntu 12.04 LTS. In order to try out some .NET exercises, I installed the below mono packages:

sudo apt-get install mono-runtime mono-mcs mono-vbnc

Now, I've got the mono csharp compiler (mcs) working fine. However, the VB.NET compiler (vbnc) is throwing the below error:

The library 'System.Design.dll' could not be found

Any idea what have I missed ?

1
  • @TheLordofTime - Then why do we have Mono packages on Ubuntu 12.04? And why we have mono programs like tomboy and banshee ? Apr 1, 2013 at 13:47

3 Answers 3

1

vbnc will by default add many references, and apparently some of those are not installed by default on Ubuntu.

I do not know what you have to install to get System.Design.dll, but you can disable the default references by passing -noconfig:

vbnc -noconfig test.vb

Note that this will also disable a few other default features, most notably all the default imports will be disabled too.

So for instance this code:

Class Test
    Shared Sub Main
        Console.WriteLine ("Hello World")
    End Sub
End Class

when compiled like this:

vbnc -noconfig test.vb

will fail with:

test.vb (3,21) : error VBNC30451: 'Console' is not declared. It may be inaccessible due to its protection level.

The fix is easy, just pass -imports: to vbnc

vbnc -noconfig test.vb -imports:System

and now it should compile just fine.

1

Rolf, unfortunately your solution doesn't work in Ubuntu 12.04.2 LTS:

$ vbnc -noconfig test.vb -imports:System
Visual Basic.Net Compiler version 0.0.0.5943
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.

Error VBNC30456: 'ComponentModel' is not a member of 'Global.System'.
Error VBNC30456: 'CodeDom' is not a member of 'Global.System'.
Error VBNC30456: 'ComponentModel' is not a member of 'Global.System'.
Error VBNC30456: 'CodeDom' is not a member of 'Global.System'.
Error VBNC30456: 'CodeDom' is not a member of 'Global.System'.
There were 5 errors and 0 warnings.

Actually, you should use vbnc2 to compile your code, like this:

$ vbnc2 test.vb
Visual Basic.Net Compiler version 0.0.0.5943
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.

Assembly 'test, Version=0.0, Culture=neutral, PublicKeyToken=null' saved successfully to 'test.exe'.
Compilation successful

Good luck!

0

I have resolved the same issue the next way:

sudo apt-get install libmono-system-design4.0-cil

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .