Browse Source

If the newly created project is prior to .NET 4.5, set Platform to x86 instead of AnyCPU (32-bit preferred)

Otherwise the compiled program will not run
pull/50/head
Linquize 12 years ago
parent
commit
163450c285
  1. 2
      src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs

2
src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs

@ -114,7 +114,7 @@ namespace ICSharpCode.SharpDevelop.Project
if (fx != null) if (fx != null)
UpdateAppConfig(fx); UpdateAppConfig(fx);
if (Project.OutputType != OutputType.Library) { if (Project.OutputType != OutputType.Library) {
if (DotnetDetection.IsDotnet45Installed()) { if (DotnetDetection.IsDotnet45Installed() && fx.IsBasedOn(TargetFramework.Net45)) {
Project.SetProperty(null, Project.ActivePlatform, "Prefer32Bit", "True", PropertyStorageLocations.PlatformSpecific, true); Project.SetProperty(null, Project.ActivePlatform, "Prefer32Bit", "True", PropertyStorageLocations.PlatformSpecific, true);
} else { } else {
Project.SetProperty(null, Project.ActivePlatform, "PlatformTarget", "x86", PropertyStorageLocations.PlatformSpecific, true); Project.SetProperty(null, Project.ActivePlatform, "PlatformTarget", "x86", PropertyStorageLocations.PlatformSpecific, true);

Loading…
Cancel
Save