SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Compiling native 64bit exe files.

Last post 09-01-2010 11:32 PM by binarycortex. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-30-2010 11:40 PM

    Compiling native 64bit exe files.

    I created a page for this on the wiki but it seems it was deleted. So I'll post it here. In my opinion, one of the biggest shortcomings of this wonderful software is the lack ability to compile 64 bit native exe files. Fortunately, if you have the .net framework installed, then you have the compilers available. I don't know if you can cross compile a 64bit exe from a 32 bit operating system because I don't have one to test on.

    The first thing I did was to add 64bit entries in to the solution file:

    Microsoft Visual Studio Solution File, Format Version 10.00
    # Visual Studio 2008
    # SharpDevelop 3.2.0.5777
    Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "FileLocker", "FileLocker\FileLocker.vbproj", "{03BE0B72-8520-4EA8-B26C-5AB30206287A}"
    EndProject
    Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
            Debug|x86 = Debug|x86
            Release|x86 = Release|x86
            Debug|x64 = Debug|x64
            Release|x64 = Release|x64

        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Debug|x86.Build.0 = Debug|x86
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Debug|x86.ActiveCfg = Debug|x86
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Release|x86.Build.0 = Release|x86
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Release|x86.ActiveCfg = Release|x86
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Debug|x64.Build.0 = Debug|x64
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Debug|x64.ActiveCfg = Debug|x64
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Release|x64.Build.0 = Release|x64
            {03BE0B72-8520-4EA8-B26C-5AB30206287A}.Release|x64.ActiveCfg = Release|x64

        EndGlobalSection
    EndGlobal

    Next, I edited the .vbproj file (should be similar for .csproj files) and copied the x86 Platform definition, to create an x64 Platform definition:

      <PropertyGroup Condition=" '$(Platform)' == 'x86' ">
        <PlatformTarget>x86</PlatformTarget>
        <RegisterForComInterop>False</RegisterForComInterop>
        <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
        <BaseAddress>4194304</BaseAddress>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Platform)' == 'x64' ">
        <PlatformTarget>x64</PlatformTarget>
        <RegisterForComInterop>False</RegisterForComInterop>
        <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
        <BaseAddress>4194304</BaseAddress>
      </PropertyGroup>

    Note: These files will still open in sharpdevelop without issues.

    Next, it's time to compile. Open a command prompt and navagate to your solultion (.sln) file. Now type the following command (assumes .Net Framework 3.5 is being targeted).

    SET PATH=C:\Windows\Microsoft.NET\Framework64\v3.5\;%path%

    Now that the path is set we compile, The following command is set to build the Release|x64 version.

    msbuild /p:Configuration="Release" /p:Platform="x64" ProjectName.sln

    And there you have it, a native 64bit application created with SharpDevelop.

  • 08-31-2010 12:46 AM In reply to

    Re: Compiling native 64bit exe files.

    Build > Edit Configurations/Platforms

  • 09-01-2010 11:32 PM In reply to

    Re: Compiling native 64bit exe files.

    Well that's intuitive, and by intuitive I mean not intuitive. Thanks for pointing that out.

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.