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 @@
</Actions> </Actions>
<!-- Template Content --> <!-- Template Content -->
<Project language = "C#" defaultPlatform="x86"> <Project language = "C#">
<ProjectItems> <ProjectItems>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -28,7 +28,6 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
<ApplicationIcon>..\..\StartUp\Project\Resources\SharpDevelop.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>Full</DebugType> <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
supports32BitPreferred = false; supports32BitPreferred = false;
if (DotnetDetection.IsDotnet45Installed()) { if (DotnetDetection.IsDotnet45Installed()) {
supports32BitPreferred = projectOptions.Project.MinimumSolutionVersion >= Solution.SolutionVersionVS2010; supports32BitPreferred = projectOptions.Project.MinimumSolutionVersion >= Solution.SolutionVersionVS2010;
var compilableProject = projectOptions.Project as CompilableProject; // Show 32 vs. 64 options even for library projects;
if (compilableProject != null && compilableProject.OutputType == OutputType.Library) // it's relevant for web applications.
supports32BitPreferred = false;
} }
if (supports32BitPreferred) { if (supports32BitPreferred) {
this.TargetCPU.Add(new KeyItemPair("AnyCPU32", StringParser.Parse("${res:Dialog.ProjectOptions.Build.TargetCPU.Any32}"))); 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
} }
if (fx != null) if (fx != null)
UpdateAppConfig(fx); 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(); base.ProjectCreationComplete();
} }

Loading…
Cancel
Save