Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2229  / 3 Years ago, sat, september 25, 2021, 6:37:10

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 ?


More From » mono

 Answers
6

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.


[#31938] Sunday, September 26, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
howesale

Total Points: 224
Total Questions: 117
Total Answers: 116

Location: Nauru
Member since Thu, May 18, 2023
1 Year ago
;