8

I just installed Mono version 2.10.8 and MonoDevelop 2.8.6.5 on a Mac. When I create a new project (File -> New solution -> VBNet -> ASP.NET -> Web Application) it gives me an error after creating: Error while trying to load the project '/Users/starquake/Development/Mono/HelloWorld/HelloWorld.vbproj': Project does not support framework '.NETFramework,Version=v4.0'

What am I doing wrong? Or how can I fix it?

StarQuake
  • 147
  • 1
  • 2
  • 11

4 Answers4

6

I had this problem when creating new VB Projects, I changed the file format to use when creating new projects to MSBuild (Visual Studio 2008) instead of the default MSBuild (Visual Studio 2010) From Preferences > Load/Save

Jake Burton
  • 836
  • 9
  • 9
  • 1
    I'm using MonoDevelop 5.10. I don't see a way to change the file format in Edit>Preferences>Load/Save. How to change file format to use when recovering a project develop on Visual Studio? – Revolucion for Monica Jul 01 '16 at 08:46
2

Using a text editor, change your *.vbproj file to add the following line:

    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

to the first PropertyGroup, e.g.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    ...
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
  </PropertyGroup>
  ...
</Project>
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
1

I had the same problem in Linux, but it seems that the version that properly supports VB.Net (at least without causing errors) is MonoDevelop 3.0.4, & after a google search, I landed on a SourceForge.net page with the newer MonoDevelop 3.0.6 source code.

I downloaded it, Extracted it's contents, & did the following in a root terminal...

      cd /home/knoppix/Downloads/monodevelop-3.0.6
      ./configure --prefix=`pkg-config --variable=prefix mono`
      make
      make install

Then closed the terminal, & ran MonoDevelop again, & it was no longer the version I had before (MonoDevelop 3.0.3), was now MonoDevelop 3.0.6.

When I created a new VB.Net GTK# 2.0 project, the errors were still there, but then I right-clicked on the project in the solution explorer, & chose Options, then under Build, I selected General... the 4.0 profile was now there, & could be selected. After selecting it, & closing the dialog, all the errors vanished.

I then changed the default format of new projects to MSBuild (Visual Studio 2010) from Edit, Preferences... then in the pop up dialog under Preferences, Load/Save.

I am still confused as to how to create a form though. C# side of things can create it easily, but I don't see the option in the VB side. I might have to install some other things to enable it, or something.

DTeCH
  • 51
  • 6
  • I can't find mentioned option in my MonoDevelop. It seems it is no longer available (?) in Monodevelop. Anyway, I reported a bug: https://bugzilla.xamarin.com/show_bug.cgi?id=38508 – matandked Feb 05 '16 at 20:28
0

The VB.NET addin in MonoDevelop doesn't support the .NET 4.0 framework. I'm surprised it let you create an invalid project - that seems like a bug. Please file a report at http://bugzilla.xamarin.com.

Mikayla Hutchinson
  • 16,113
  • 2
  • 44
  • 50
  • As I commented above, it didn't happen after recreating the project. So there's no steps to reproduce and I'm not quite sure how it happened. So I can't report a bug. I will keep my eyes open to see if it happens again. – StarQuake Mar 13 '12 at 14:09
  • Definitely still does this on 'Create New Solution->VBNet->Console app'. (Ubuntu-repo versions (monodevelop 2.8.6.3 and mono 2.10.8.1)) Once I edited the .vcproj file to set the to 3.5 worked fine. – David V Apr 29 '13 at 23:22