Bug 5050 - creating a new vb.net solution
Summary: creating a new vb.net solution
Status: CONFIRMED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: VB.Net Binding ()
Version: 2.8.6
Hardware: All All
: Lowest normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-13 12:01 UTC by nabilbarakat2000
Modified: 2015-01-13 07:38 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 5050 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description nabilbarakat2000 2012-05-13 12:01:42 UTC
When creating a new vb.net solution MonoDevelop responds with the following message:

Error while trying to load the project 'project path and name.vbproj': Project does not support framework '.NETFramework,Version=v4.0'

OS is UBUNTU 12.04 LTS

MonoDevelop installed from UBUNTU Software center
Comment 1 Matthew MacGregor 2014-11-07 00:54:12 UTC
I can validate that this is still occurring in version 5.5.3:

Error while trying to load the project '/Users/Matthew/Projects/TestVB/TestVB/TestVB.vbproj': Project does not support framework '.NETFramework,Version=v4.5'

Steps to reproduce:

1. Create a new VB console app in Xamarin Studio.
2. The error message above will appear.

Mac OSX Version 10.10

The problem is resolved by removing this line from the .vbproj file:

    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

Alternately setting it to 4.0 will also resolve the issue, so I tried to track down in code where precisely this was failing. 

The error is happening in DotNetProject.cs just after line 337. The problem seems to be that the VBLanguageBinding supports CLR versions 2.0 or 4.0, but the default framework CLR version is set to 4.5. 

VBlanguageBinding.cs line 92:

	public ClrVersion[] GetSupportedClrVersions ()
	{
		return new ClrVersion[] { ClrVersion.Net_2_0, ClrVersion.Net_4_0 };
	}
		
In DotNetProject.cs line 403 (SupportsFramework):

	foreach (ClrVersion v in versions) {
		if (v == framework.ClrVersion) // ClrVersion is set to 4.5
			return true;
	}
	
ClrVersion is set to Net_4_5 by SystemAssemblyService.GetTargetFramework():

fx	{[TargetFramework: Hidden=False, Name=Mono / .NET 4.5, Id=.NETFramework,Version=v4.5, ClrVersion=Net_4_5]}	MonoDevelop.Core.Assemblies.TargetFramework

Typically I'm used to referring to framework version and CLR separately, ie:

.NET 4.5.2, CLR 4
.NET 4.5.1, CLR 4
.NET 4.5, 	CLR 4
.NET 4, 	CLR 4

So it seems likely that either the CLR version was mistakenly set to 4.5 and the VBLanguageBinding is correct, or Xamarin Studio is using CLR version a little differently?

It's worth noting that the CSLanguageBinding has the following:

	public ClrVersion[] GetSupportedClrVersions ()
	{
		return new ClrVersion[] { 
			ClrVersion.Net_1_1, 
			ClrVersion.Net_2_0, 
			ClrVersion.Clr_2_1,
			ClrVersion.Net_4_0,
			ClrVersion.Net_4_5
		};
	}

I added Net_4_5 to VBLanguageBinding.GetSupportedClrVersions() and the project is now generated without error:

	public ClrVersion[] GetSupportedClrVersions ()
	{
		return new ClrVersion[] { 
			ClrVersion.Net_2_0, 
			ClrVersion.Net_4_0, 
			ClrVersion.Net_4_5 
		};
	}

That's all the detail I can provide!
Comment 2 Prashant manu 2015-01-13 07:04:39 UTC
We have checked with the steps in comment 1  and able to reproduce it on Win and MAC also. Screencast: http://screencast.com/t/oPsLlLhbfdWB

Supplement Info:
IDE log: https://gist.github.com/saurabh360/884bbbe29f677101f570

Environment Info:
All MAC/Win
Xamarin Studio Version 5.7 (build 661)
Build Information
Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 11:27:37-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7
Comment 3 Prashant manu 2015-01-13 07:38:52 UTC
Complete Environment Info:
Xamarin Studio
Version 5.7 (build 661)
Installation UUID: a11fadb0-d7b1-4e4b-b5dd-787b243e880f
Runtime:
	Microsoft .NET 4.0.30319.0
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

Xamarin.Android
Version: 4.20.0 (Trial Edition)
Android SDK: E:\android-sdk
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: C:\Program Files\Java\jdk1.7.0_67
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Build Information
Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 11:27:37-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

Operating System
Windows 6.1.7601.65536 (64-bit)