2

I'm trying to use MonoDevelop to compile Visual Basic in Ubuntu. I've installed MonoDevelop 4.2.2 as instructed in this thread from "ppa:ermshiperete/monodevelop". However I cannot build the sample Visual Basic project. With the following error:

/opt/monodevelop/lib/mono/4.5/Microsoft.VisualBasic.targets: Error: Error executing task Vbc: Argument cannot be null.

Parameter name: pathToTool (Test)

I'm clearly missing some setup to build VB projects, any ideas how I can get them working?

I've tried:

  • Reading the mentioned VB targets file doesn't show obviously where I should define a pathToTool parameter and I'm not exactly sure the Visual Basic tools it's referring to are even installed (though I don't know where to look.)
  • Using a VM with Visual Studio. This works but it's annoying.
  • Using a better programming language; colleges choice.
  • I'm having the same problem, did you solve it? – dusan Jul 11 '14 at 20:15
  • Unfortunately not. – James Jul 12 '14 at 9:16
  • same problem here - it's been two months, maybe some of you has figured it out? – peter Jul 15 '14 at 14:33
1

I use openSUSE 13.1 and installed MonoDevelop 5.0.1 from "Mono:Factory" repository. These are the steps I used to solve the problem in my case:

NOTE: You can jump to step 3 if you do not want to use the "MSBuild build engine" which is described in step 3.3

  1. Make a backup copy of "/usr/lib/mono/4.5/Microsoft.VisualBasic.targets" and then open it as root:

    sudo kate /usr/lib/mono/4.5/Microsoft.VisualBasic.targets

    or

    sudo gedit /usr/lib/mono/4.5/Microsoft.VisualBasic.targets

  2. In section "vbc" change the last parameter "ToolPath" to the directory where vbnc is located:

  3. Change some configuration of the "Project" in MonoDevelop if you face this error:

    error VBNC2017: The library 'Microsoft.VisualBasic.dll' could not be found.

  4. In MonoDevelop go to menu "Project\YOURPROJECTNAME Options"

  5. In "Build\General" set "Target framework" to "Mono / .net 4.0":

    Target framework: Mono / .net 4.0

    • In "Build\Compiler" set "Additional compiler arguments" to "-libpath:YOUR-PATH-TO-MONO-4.0"

    Additional compiler arguments: -libpath:/usr/lib/mono/4.0/

  6. In case you get the above mentioned error, again, go to "Build\General" and under the section "Build Engine" uncheck the "Use MSBuild build engine ..."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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