Browse Source

Create new projects as Any CPU (32-bit) if the .NET 4.5 framework is installed.

Any CPU (32-bit) also works with older target frameworks as those interpret the 32-bit preferred flag as 32-bit required; but we require the new compiler version.
pull/31/head
Daniel Grunwald 13 years ago
parent
commit
ea71582c4f
  1. 2
      data/templates/project/CSharp/ConsoleProject.xpt
  2. 2
      data/templates/project/CSharp/FormsProject.xpt
  3. 2
      data/templates/project/CSharp/NotifyIcon.xpt
  4. 2
      data/templates/project/CSharp/Service.xpt
  5. 2
      data/templates/project/CSharp/WPFApplication.xpt
  6. 2
      data/templates/project/CSharp/WPFNavigationApplication.xpt
  7. 2
      data/templates/project/VB/ConsoleProject.xpt
  8. 2
      data/templates/project/VB/FormsProject.xpt
  9. 2
      data/templates/project/VB/NotifyIcon.xpt
  10. 2
      data/templates/project/VB/Service.xpt
  11. 2
      data/templates/project/VB/WPFApplication.xpt
  12. 2
      data/templates/project/VB/WPFNavigationApplication.xpt
  13. 1
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  14. 5
      src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildAdvanced.xaml.cs
  15. 7
      src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs

2
data/templates/project/CSharp/ConsoleProject.xpt

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
</Actions>
<!-- Template Content -->
<Project language = "C#" defaultPlatform="x86">
<Project language = "C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/FormsProject.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "MainForm.cs"/>
</Actions>
<Project language = "C#" defaultPlatform="x86">
<Project language = "C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/NotifyIcon.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "NotificationIcon.cs"/>
</Actions>
<Project language="C#" defaultPlatform="x86">
<Project language="C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/Service.xpt

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
</Actions>
<!-- Template Content -->
<Project language = "C#" defaultPlatform="x86">
<Project language = "C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />

2
data/templates/project/CSharp/WPFApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Window1.xaml"/>
</Actions>
<Project language = "C#" defaultPlatform="x86">
<Project language = "C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/WPFNavigationApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Page1.xaml"/>
</Actions>
<Project language = "C#" defaultPlatform="x86">
<Project language = "C#">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/ConsoleProject.xpt

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
<!-- Template Content -->
<Project language = "VBNet" defaultPlatform="x86">
<Project language = "VBNet">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/FormsProject.xpt

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
</Actions>
<!-- Template Content -->
<Project language="VBNet" defaultPlatform="x86">
<Project language="VBNet">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>

2
data/templates/project/VB/NotifyIcon.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "NotificationIcon.vb"/>
</Actions>
<Project language="VBNet" defaultPlatform="x86">
<Project language="VBNet">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/Service.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "${ProjectName}.vb"/>
</Actions>
<Project language="VBNet" defaultPlatform="x86">
<Project language="VBNet">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>

2
data/templates/project/VB/WPFApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "MainWindow.xaml"/>
</Actions>
<Project language = "VBNet" defaultPlatform="x86">
<Project language = "VBNet">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/WPFNavigationApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Page1.xaml"/>
</Actions>
<Project language = "VBNet" defaultPlatform="x86">
<Project language = "VBNet">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

1
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -28,7 +28,6 @@ @@ -28,7 +28,6 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<ApplicationIcon>..\..\StartUp\Project\Resources\SharpDevelop.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>Full</DebugType>

5
src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/BuildAdvanced.xaml.cs

@ -61,9 +61,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -61,9 +61,8 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
supports32BitPreferred = false;
if (DotnetDetection.IsDotnet45Installed()) {
supports32BitPreferred = projectOptions.Project.MinimumSolutionVersion >= Solution.SolutionVersionVS2010;
var compilableProject = projectOptions.Project as CompilableProject;
if (compilableProject != null && compilableProject.OutputType == OutputType.Library)
supports32BitPreferred = false;
// Show 32 vs. 64 options even for library projects;
// it's relevant for web applications.
}
if (supports32BitPreferred) {
this.TargetCPU.Add(new KeyItemPair("AnyCPU32", StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.Any32}")));

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

@ -113,6 +113,13 @@ namespace ICSharpCode.SharpDevelop.Project @@ -113,6 +113,13 @@ namespace ICSharpCode.SharpDevelop.Project
}
if (fx != null)
UpdateAppConfig(fx);
if (Project.OutputType != OutputType.Library) {
if (DotnetDetection.IsDotnet45Installed()) {
Project.SetProperty(null, Project.ActivePlatform, "Prefer32Bit", "True", PropertyStorageLocations.PlatformSpecific, true);
} else {
Project.SetProperty(null, Project.ActivePlatform, "TargetPlatform", "x86", PropertyStorageLocations.PlatformSpecific, true);
}
}
base.ProjectCreationComplete();
}

Loading…
Cancel
Save