Show/Hide Toolbars

XSharp

Specifies which version of the common language runtime (CLR) can run the assembly.

Syntax

-platform:string  

Arguments

stringanycpu (default), anycpu32bitpreferred, ARM, x64, x86, or Itanium.

Remarks

anycpu (default) compiles your assembly to run on any platform. Your application runs as a 64-bit process whenever possible and falls back to 32-bit when only that mode is available.

anycpu32bitpreferred compiles your assembly to run on any platform. Your application runs in 32-bit mode on systems that support both 64-bit and 32-bit applications. You can specify this option only for projects that target the .NET Framework 4.5.

ARM compiles your assembly to run on a computer that has an Advanced RISC Machine (ARM) processor.

x64 compiles your assembly to be run by the 64-bit common language runtime on a computer that supports the AMD64 or EM64T instruction set.

x86 compiles your assembly to be run by the 32-bit, x86-compatible common language runtime.

Itanium compiles your assembly to be run by the 64-bit common language runtime on a computer with an Itanium processor.

 

On a 64-bit Windows operating system:

 

Assemblies compiled with -platform:x86 execute on the 32-bit CLR running under WOW64.

A DLL compiled with The -platform:anycpu executes on the same CLR as the process into which it is loaded.

Executables that are compiled with The -platform:anycpu execute on the 64-bit CLR.

Executables compiled with -platform:anycpu32bitpreferred execute on the 32-bit CLR.

 

The anycpu32bitpreferred setting is valid only for executable (.EXE) files, and it requires the .NET Framework 4.5.

To set this compiler option in the Visual Studio development environment

 

1.Open the Properties page for the project.

2.Click the General property page.

3.Modify the Platform target property and, for projects that target the .NET Framework 4.5, select or clear the Prefer 32-bit check box.

4.Click here to see the property page

Example

 

The following example shows how to use The -platform option to specify that the application should be run by the 64-bit CLR on a 64-bit Windows operating system.

 

 

xsc -platform:anycpu filename.prg