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. 5
      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;

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

@ -402,9 +402,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -402,9 +402,6 @@ 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;
MSBuild.Project project = MSBuildInternals.LoadProject(projectCollection, projectFile, globalProps);
if (openCurrentConfiguration)
@ -1246,7 +1243,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -1246,7 +1243,9 @@ namespace ICSharpCode.SharpDevelop.Project
{
this.projectCollection = loadInformation.ParentSolution.MSBuildProjectCollection;
this.FileName = loadInformation.FileName;
if (loadInformation.Configuration != null)
this.ActiveConfiguration = loadInformation.Configuration;
if (loadInformation.Platform != null)
this.ActivePlatform = loadInformation.Platform;
projectFile = ProjectRootElement.Open(loadInformation.FileName, projectCollection);

Loading…
Cancel
Save