Browse Source

Fixed crash when adding new/existing projects to an existing solution.

newNRvisualizers
Daniel Grunwald 13 years ago
parent
commit
35394eb1af
  1. 4
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  2. 11
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

4
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -186,6 +186,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -186,6 +186,8 @@ namespace ICSharpCode.SharpDevelop.Project
get { return activeConfiguration; }
set {
WorkbenchSingleton.AssertMainThread();
if (value == null)
throw new ArgumentNullException();
if (activeConfiguration != value) {
activeConfiguration = value;
@ -210,6 +212,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -210,6 +212,8 @@ namespace ICSharpCode.SharpDevelop.Project
get { return activePlatform; }
set {
WorkbenchSingleton.AssertMainThread();
if (value == null)
throw new ArgumentNullException();
if (activePlatform != value) {
activePlatform = value;

11
src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

@ -402,10 +402,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -402,10 +402,7 @@ namespace ICSharpCode.SharpDevelop.Project
Dictionary<string, string> globalProps = new Dictionary<string, string>();
InitializeMSBuildProjectProperties(globalProps);
globalProps["Configuration"] = configuration;
//HACK: the ActivePlatform property should be set properly before entering here, but sometimes it does not
if (platform != null)
globalProps["Platform"] = platform;
globalProps["Platform"] = platform;
MSBuild.Project project = MSBuildInternals.LoadProject(projectCollection, projectFile, globalProps);
if (openCurrentConfiguration)
currentlyOpenProject = project;
@ -1246,8 +1243,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -1246,8 +1243,10 @@ namespace ICSharpCode.SharpDevelop.Project
{
this.projectCollection = loadInformation.ParentSolution.MSBuildProjectCollection;
this.FileName = loadInformation.FileName;
this.ActiveConfiguration = loadInformation.Configuration;
this.ActivePlatform = loadInformation.Platform;
if (loadInformation.Configuration != null)
this.ActiveConfiguration = loadInformation.Configuration;
if (loadInformation.Platform != null)
this.ActivePlatform = loadInformation.Platform;
projectFile = ProjectRootElement.Open(loadInformation.FileName, projectCollection);
if (loadInformation.upgradeToolsVersion == true && CanUpgradeToolsVersion()) {

Loading…
Cancel
Save