Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C#
C# Reference
C# Compiler Options
 /platform (Specify Output Platform)
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
C# Language Reference 
/platform (Specify Output Platform) (C# Compiler Options) 

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

/platform:string

Parameters

string

x86, Itanium, x64, or anycpu (default).

  • 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.

  • 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.

  • anycpu (default) compiles your assembly to run on any platform.

On a 64-bit Windows operating system:

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

  • Executables compiled with the /platform:anycpu will execute on the 64 bit CLR.

  • DLLs compiled with the /platform:anycpu will execute on the same CLR as the process into which it is being loaded.

For more information about developing an application to run on a Windows 64-bit operating system, see 64-bit Applications.

To set this compiler option in the Visual Studio development environment

  1. Open the Properties page for the project. For details, see How to: Set Project Properties (C#, J#).

  2. Click the Build property page.

  3. Modify the Platform target property.

Note   /platform is not available in the development environment in Visual C# Express.

For information on how to set this compiler option programmatically, see PlatformTarget.

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

csc /platform:Itanium myItanium.cs

Other Resources

C# Compiler Options

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Targeting 32Bit only from C# Express      EricLaw-MSFT   |   Edit   |   Show History
If you're building an application which hosts the web browser control, you may wish to force it to run in 32bits so content like Flash and Silverlight works within the HTML.

See http://blogs.msdn.com/ieinternals/archive/2010/01/13/Web-Browser-Control-does-not-show-Flash-or-Silverlight-in-a-64bit-Dot-Net-Application.aspx for information on how to force 32bit execution, even if compiled with C# Express.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker