Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ?

share|improve this question
    
The solution is to not be building .NET stuff on a Linux environment. –  Thomas W. Apr 1 '13 at 13:42
    
@TheLordofTime - Then why do we have Mono packages on Ubuntu 12.04? And why we have mono programs like tomboy and banshee ? –  Prahlad Yeri Apr 1 '13 at 13:47
add comment

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.