Export (0) Print
Expand All

/unsafe (Enable Unsafe Mode)

/unsafe

Remarks

The /unsafe option allows code that uses the unsafe keyword to compile.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C# Project Properties.
  2. Click the Configuration Properties folder.
  3. Click the Build property page.
  4. Modify the Allow unsafe code blocks property.

To set this compiler option programmatically

See AllowUnsafeBlocks Property.

Example

Compile in.cs for unsafe mode:

csc /unsafe in.cs

See Also

C# Compiler Options

Show:
© 2014 Microsoft