Partilhar via


/target:appcontainerexe (C# Compiler Options)

If you use the /target:appcontainerexe compiler option, the compiler creates a Windows executable (.exe) file that must be run in an app container. This option is equivalent to /target:winexe but is designed for Windows Store apps.

/target:appcontainerexe

Remarks

To require the app to run in an app container, this option sets a bit in the Portable Executable (PE) file. When that bit is set, an error occurs if the CreateProcess method tries to launch the executable file outside an app container.

Unless you use the /out option, the output file name takes the name of the input file that contains the Main method.

When you specify this option at a command prompt, all files until the next /out or /target option are used to create the executable file.

To set this compiler option in the IDE

  1. In Solution Explorer, open the shortcut menu for your project, and then choose Properties.

  2. On the Application tab, in the Output type list, choose Windows Store App.

    This option is available only for Windows Store app templates.

For information about how to set this compiler option programmatically, see OutputType.

Example

The following command compiles filename.cs into a Windows executable file that can be run only in an app container.

csc /target:appcontainerexe filename.cs

See Also

Reference

/target (C# Compiler Options)

/target:winexe (C# Compiler Options)

Other Resources

C# Compiler Options