Browse Source

Fix #51 - Create VS2012 solution file when needed.

pull/326/merge
Daniel Grunwald 12 years ago
parent
commit
997420193c
  1. 9
      src/Main/Base/Project/Project/TargetFrameworks/DotNet4x.cs
  2. 17
      src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs
  3. 12
      src/Main/Base/Project/Src/Project/CompilableProject.cs

9
src/Main/Base/Project/Project/TargetFrameworks/DotNet4x.cs

@ -94,6 +94,15 @@ namespace ICSharpCode.SharpDevelop.Project @@ -94,6 +94,15 @@ namespace ICSharpCode.SharpDevelop.Project
// This implementation is used for all non-client versions of .NET 4.x
return fx != null && fx.IsDesktopFramework && fx.Version <= this.Version;
}
public override SolutionFormatVersion MinimumSolutionVersion {
get {
if (this.Version <= Versions.V4_0)
return SolutionFormatVersion.VS2010;
else
return SolutionFormatVersion.VS2012;
}
}
}
/// <summary>

17
src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs

@ -87,7 +87,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -87,7 +87,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// <summary>
/// Gets the minimum MSBuild version required to build projects with this target framework.
/// </summary>
public abstract Version MinimumMSBuildVersion { get; } // TODO: maybe remove this property?
public abstract Version MinimumMSBuildVersion { get; }
/// <summary>
/// Gets whether this is the MS.NET Framework for the desktop. (not Mono, not WinPhone/Win8 app/portable library/...)
@ -142,6 +142,21 @@ namespace ICSharpCode.SharpDevelop.Project @@ -142,6 +142,21 @@ namespace ICSharpCode.SharpDevelop.Project
return true;
}
/// <summary>
/// Gets the solution format version corresponding to the older version of Visual Studio that supports this target framework.
/// </summary>
/// <remarks>The default implementation of this property is based on the <see cref="MinimumMSBuildVersion"/> property.</remarks>
public virtual SolutionFormatVersion MinimumSolutionVersion {
get {
if (MinimumMSBuildVersion <= Versions.V2_0)
return SolutionFormatVersion.VS2005;
else if (MinimumMSBuildVersion <= Versions.V3_5)
return SolutionFormatVersion.VS2008;
else
return SolutionFormatVersion.VS2010;
}
}
/* We might implement+use this API in the future if we want to notify the user about missing reference assemblies.
/// <summary>
/// Tests whether the reference assemblies for this framework are installed on this machine.

12
src/Main/Base/Project/Src/Project/CompilableProject.cs

@ -282,6 +282,18 @@ namespace ICSharpCode.SharpDevelop.Project @@ -282,6 +282,18 @@ namespace ICSharpCode.SharpDevelop.Project
base.Dispose();
}
public override SolutionFormatVersion MinimumSolutionVersion {
get {
SolutionFormatVersion v = base.MinimumSolutionVersion;
var fx = this.CurrentTargetFramework;
// Check if the current target framework has higher requirements than the ToolsVersion:
if (fx != null && fx.MinimumSolutionVersion > v) {
v = fx.MinimumSolutionVersion;
}
return v;
}
}
#region IUpgradableProject
[Browsable(false)]
public virtual bool UpgradeDesired {

Loading…
Cancel
Save