SharpDevelop Community

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

AnyCPU target builds ILONLY 32BITREQUIRED on .Net 4.5

Last post 12-22-2012 2:27 PM by DanielGrunwald. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-25-2012 6:30 AM

    AnyCPU target builds ILONLY 32BITREQUIRED on .Net 4.5

    I'm using version 4.2.2 (build 8818) of SharpDevelop. I have the Windows 8 SDK installed, along with the Windows 7 SDK.

    Creating a new C# Console Application targeting .Net 4.5, and changing the target CPU to "Any Processor" creates an EXE with the following flags according to IL DASM:

    .corflags 0x00020003    //  ILONLY 32BITREQUIRED

    Performing the same steps, but selecting a C# Class Library, generates a DLL with the expected flags:

    .corflags 0x00000001    //  ILONLY

    Beyond using corflags.exe to fix the assembly, this means I can't run executables in 64-bit mode!

    I'm guessing it's not setting up the project file correctly for msbuild, but I haven't got Visual Studio 2012 installed to find out the correct setup. It's currently downloading, and I'll post an update when I figure it out.

    Filed under: , ,
  • 09-25-2012 7:18 AM In reply to

    Re: AnyCPU target builds ILONLY 32BITREQUIRED on .Net 4.5

    Well, I installed Visual Studio 2012, repeated the same steps and compared the project files.

    VS 2012 puts a Prefer32Bit element in the platform target property group:


    Manually adding that element to my project files fixed my issue. Since SharpDevelop doesn't put it in for .Net 4.5 targets, builds that target AnyCPU currently won't work as expected.

    Seems SharpDevelop also defaults to opening the .Net 3.5 version of IL DASM, hence it reporting 32BITREQUIRED rather than 32BITPREFERRED.

  • 12-22-2012 2:27 PM In reply to

    Re: AnyCPU target builds ILONLY 32BITREQUIRED on .Net 4.5

    I have implemented support for the new Any CPU options in SharpDevelop

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