Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions docs/csharp/language-reference/compiler-messages/cs0702.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ caps.latest.revision: 10
author: "BillWagner"
ms.author: "wiwagn"
---
# Compiler Error CS0702
# Compiler error CS0702
Constraint cannot be special class 'identifier'

The following types may not be used as constraints: `System.Object,``System.Array`, `System.Delegate`, `System.Enum`, or `System.ValueType`.
The following types may not be used as constraints: <xref:System.Object>, <xref:System.Array>, or <xref:System.ValueType>.

## Example
The following sample generates CS0702:
Expand All @@ -29,5 +29,5 @@ class C<T> where T : System.Array // CS0702
}
```

## See Also
[Constraints on Type Parameters](../../../csharp/programming-guide/generics/constraints-on-type-parameters.md)
## See also
[Constraints on Type Parameters](../../programming-guide/generics/constraints-on-type-parameters.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "-deterministic (C# Compiler Options)"
ms.date: 04/12/2018
ms.prod: .net
ms.technology:
- "devlang-csharp"
ms.topic: "article"
f1_keywords:
- "/deterministic"
helpviewer_keywords:
- "-deterministic compiler option [C#]"
- "deterministic compiler option [C#]"
- "/deterministic compiler option [C#]"
author: "rpetrusha"
ms.author: "ronpet"
---
# -deterministic

Causes the compiler to produce an assembly whose byte-for-byte output is identical across compilations for identical inputs.

## Syntax

```
-deterministic
```

## Remarks

By default, compiler output from a given set of inputs is unique, since the compiler adds a timestamp and a GUID that is generated from random numbers. You use the `-deterministic` option to produce a *deterministic assembly*, one whose binary content is identical across compilations as long as the input remains the same.

The compiler considers the following inputs for the purpose of determinism:

- The sequence of command-line parameters.
- The contents of the compiler's .rsp response file.
- The precise version of the compiler used, and its referenced assemblies.
- The current directory path.
- The binary contents of all files explicitly passed to the compiler either directly or indirectly, including:
- Source files
- Referenced assemblies
- Referenced modules
- Resources
- The strong name key file
- @ response files
- Analyzers
- Rulesets
- Additional files that may be used by analyzers
- The current culture (for the language in which diagnostics and exception messages are produced).
- The default encoding (or the current code page) if the encoding is not specified.
- The existence, non-existence, and contents of files on the compiler's search paths (specified, for example, by `/lib` or `/recurse`).
- The CLR platform on which the compiler is run.
- The value of `%LIBPATH%`, which can affect analyzer dependency loading.

When sources are publicly available, deterministic compilation can be used for establishing whether a binary is compiled from a trusted source. It can also be useful in a continuous build system for determining whether build steps that are dependent on changes to a binary need to be executed.

## See Also
[C# Compiler Options](../../../csharp/language-reference/compiler-options/index.md)
[Managing Project and Solution Properties](/visualstudio/ide/managing-project-and-solution-properties)
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Causes the compiler to make COM type information in the specified assemblies ava
> [!NOTE]
> When you create an instance of an embedded COM type in your code, you must create the instance by using the appropriate interface. Attempting to create an instance of an embedded COM type by using the CoClass causes an error.

To set the `-link` option in [!INCLUDE[vsprvs](~/includes/vsprvs-md.md)], add an assembly reference and set the `Embed Interop Types` property to **true**. The default for the `Embed Interop Types` property is **false**.
To set the `-link` option in Visual Studio, add an assembly reference and set the `Embed Interop Types` property to **true**. The default for the `Embed Interop Types` property is **false**.

If you link to a COM assembly (Assembly A) which itself references another COM assembly (Assembly B), you also have to link to Assembly B if either of the following is true:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "C# Compiler Options Listed Alphabetically"
ms.date: 07/20/2015
ms.date: 04/12/2018
ms.prod: .net
ms.technology:
- "devlang-csharp"
Expand All @@ -16,69 +16,70 @@ author: "BillWagner"
ms.author: "wiwagn"
---
# C# Compiler Options Listed Alphabetically
The following compiler options are sorted alphabetically. For a categorical list, see [C# Compiler Options Listed by Category](../../../csharp/language-reference/compiler-options/listed-by-category.md).
The following compiler options are sorted alphabetically. For a categorical list, see [C# Compiler Options Listed by Category](listed-by-category.md).

|Option|Purpose|
|------------|-------------|
|[@](../../../csharp/language-reference/compiler-options/response-file-compiler-option.md)|Reads a response file for more options.|
|[-?](../../../csharp/language-reference/compiler-options/help-compiler-option.md)|Displays a usage message to stdout.|
|[@](response-file-compiler-option.md)|Reads a response file for more options.|
|[-?](help-compiler-option.md)|Displays a usage message to stdout.|
|-additionalfile|Names additional files that don't directly affect code generation but may be used by analyzers for producing errors or warnings.|
|[-addmodule](../../../csharp/language-reference/compiler-options/addmodule-compiler-option.md)|Links the specified modules into this assembly|
|[-addmodule](addmodule-compiler-option.md)|Links the specified modules into this assembly|
|-analyzer|Run the analyzers from this assembly (Short form: -a)|
|[-appconfig](../../../csharp/language-reference/compiler-options/appconfig-compiler-option.md)|Specifies the location of app.config at assembly binding time.|
|[-baseaddress](../../../csharp/language-reference/compiler-options/baseaddress-compiler-option.md)|Specifies the base address for the library to be built.|
|[-bugreport](../../../csharp/language-reference/compiler-options/bugreport-compiler-option.md)|Creates a 'Bug Report' file. This file will be sent together with any crash information if it is used with -errorreport:prompt or -errorreport:send.|
|[-checked](../../../csharp/language-reference/compiler-options/checked-compiler-option.md)|Causes the compiler to generate overflow checks.|
|[-appconfig](appconfig-compiler-option.md)|Specifies the location of app.config at assembly binding time.|
|[-baseaddress](baseaddress-compiler-option.md)|Specifies the base address for the library to be built.|
|[-bugreport](bugreport-compiler-option.md)|Creates a 'Bug Report' file. This file will be sent together with any crash information if it is used with -errorreport:prompt or -errorreport:send.|
|[-checked](checked-compiler-option.md)|Causes the compiler to generate overflow checks.|
|-checksumalgorithm:\<alg>|Specify the algorithm for calculating the source file checksum stored in PDB. Supported values are: SHA1 (default) or SHA256.|
|[-codepage](../../../csharp/language-reference/compiler-options/codepage-compiler-option.md)|Specifies the codepage to use when opening source files.|
|[-debug](../../../csharp/language-reference/compiler-options/debug-compiler-option.md)|Emits debugging information.|
|[-define](../../../csharp/language-reference/compiler-options/define-compiler-option.md)|Defines conditional compilation symbols.|
|[-delaysign](../../../csharp/language-reference/compiler-options/delaysign-compiler-option.md)|Delay-signs the assembly by using only the public part of the strong name key.|
|[-doc](../../../csharp/language-reference/compiler-options/doc-compiler-option.md)|Specifies an XML Documentation file to generate.|
|[-errorreport](../../../csharp/language-reference/compiler-options/errorreport-compiler-option.md)|Specifies how to handle internal compiler errors: prompt, send, or none. The default is none.|
|[-filealign](../../../csharp/language-reference/compiler-options/filealign-compiler-option.md)|Specifies the alignment used for output file sections.|
|[-fullpaths](../../../csharp/language-reference/compiler-options/fullpaths-compiler-option.md)|Causes the compiler to generate fully qualified paths.|
|[-help](../../../csharp/language-reference/compiler-options/help-compiler-option.md)|Displays a usage message to stdout.|
|[-highentropyva](../../../csharp/language-reference/compiler-options/highentropyva-compiler-option.md)|Specifies that high entropy ASLR is supported.|
|[-codepage](codepage-compiler-option.md)|Specifies the codepage to use when opening source files.|
|[-debug](debug-compiler-option.md)|Emits debugging information.|
|[-define](define-compiler-option.md)|Defines conditional compilation symbols.|
|[-delaysign](delaysign-compiler-option.md)|Delay-signs the assembly by using only the public part of the strong name key.|
|[-deterministic](deterministic-compiler-option.md)|Causes the compiler to output an assembly whose binary content is identical across compilations if inputs are identical.|
|[-doc](doc-compiler-option.md)|Specifies an XML Documentation file to generate.|
|[-errorreport](errorreport-compiler-option.md)|Specifies how to handle internal compiler errors: prompt, send, or none. The default is none.|
|[-filealign](filealign-compiler-option.md)|Specifies the alignment used for output file sections.|
|[-fullpaths](fullpaths-compiler-option.md)|Causes the compiler to generate fully qualified paths.|
|[-help](help-compiler-option.md)|Displays a usage message to stdout.|
|[-highentropyva](highentropyva-compiler-option.md)|Specifies that high entropy ASLR is supported.|
|-incremental|Enables incremental compilation [obsolete].|
|[-keycontainer](../../../csharp/language-reference/compiler-options/keycontainer-compiler-option.md)|Specifies a strong name key container.|
|[-keyfile](../../../csharp/language-reference/compiler-options/keyfile-compiler-option.md)|Specifies a strong name key file.|
|[-langversion:\<string>](../../../csharp/language-reference/compiler-options/langversion-compiler-option.md)|Specify language version mode: Default, ISO-1, ISO-2, 3, 4, 5, 6, 7, 7.1, or Latest |
|[-lib](../../../csharp/language-reference/compiler-options/lib-compiler-option.md)|Specifies additional directories in which to search for references.|
|[-link](../../../csharp/language-reference/compiler-options/link-compiler-option.md)|Makes COM type information in specified assemblies available to the project.|
|[-linkresource](../../../csharp/language-reference/compiler-options/linkresource-compiler-option.md)|Links the specified resource to this assembly.|
|[-main](../../../csharp/language-reference/compiler-options/main-compiler-option.md)|Specifies the type that contains the entry point (ignore all other possible entry points).|
|[-moduleassemblyname](../../../csharp/language-reference/compiler-options/moduleassemblyname-compiler-option.md)|Specifies an assembly whose non-public types a .netmodule can access.|
|[-keycontainer](keycontainer-compiler-option.md)|Specifies a strong name key container.|
|[-keyfile](keyfile-compiler-option.md)|Specifies a strong name key file.|
|[-langversion:\<string>](langversion-compiler-option.md)|Specify language version mode: Default, ISO-1, ISO-2, 3, 4, 5, 6, 7, 7.1, or Latest |
|[-lib](lib-compiler-option.md)|Specifies additional directories in which to search for references.|
|[-link](link-compiler-option.md)|Makes COM type information in specified assemblies available to the project.|
|[-linkresource](linkresource-compiler-option.md)|Links the specified resource to this assembly.|
|[-main](main-compiler-option.md)|Specifies the type that contains the entry point (ignore all other possible entry points).|
|[-moduleassemblyname](moduleassemblyname-compiler-option.md)|Specifies an assembly whose non-public types a .netmodule can access.|
|-modulename:\<string>|Specify the name of the source module|
|[-noconfig](../../../csharp/language-reference/compiler-options/noconfig-compiler-option.md)|Instructs the compiler not to auto include CSC.RSP file.|
|[-nologo](../../../csharp/language-reference/compiler-options/nologo-compiler-option.md)|Suppresses compiler copyright message.|
|[-nostdlib](../../../csharp/language-reference/compiler-options/nostdlib-compiler-option.md)|Instructs the compiler not to reference standard library (mscorlib.dll).|
|[-nowarn](../../../csharp/language-reference/compiler-options/nowarn-compiler-option.md)|Disables specific warning messages|
|[-nowin32manifest](../../../csharp/language-reference/compiler-options/nowin32manifest-compiler-option.md)|Instructs the compiler not to embed an application manifest in the executable file.|
|[-optimize](../../../csharp/language-reference/compiler-options/optimize-compiler-option.md)|Enables/disables optimizations.|
|[-out](../../../csharp/language-reference/compiler-options/out-compiler-option.md)|Specifies the output file name (default: base name of file with main class or first file).|
|[-noconfig](noconfig-compiler-option.md)|Instructs the compiler not to auto include CSC.RSP file.|
|[-nologo](nologo-compiler-option.md)|Suppresses compiler copyright message.|
|[-nostdlib](nostdlib-compiler-option.md)|Instructs the compiler not to reference standard library (mscorlib.dll).|
|[-nowarn](nowarn-compiler-option.md)|Disables specific warning messages|
|[-nowin32manifest](nowin32manifest-compiler-option.md)|Instructs the compiler not to embed an application manifest in the executable file.|
|[-optimize](optimize-compiler-option.md)|Enables/disables optimizations.|
|[-out](out-compiler-option.md)|Specifies the output file name (default: base name of file with main class or first file).|
|-parallel[+&#124;-]|Specifies whether to use concurrent build (+).|
|[-pdb](../../../csharp/language-reference/compiler-options/pdb-compiler-option.md)|Specifies the file name and location of the .pdb file.|
|[-platform](../../../csharp/language-reference/compiler-options/platform-compiler-option.md)|Limits which platforms this code can run on: x86, Itanium, x64, anycpu, or anycpu32bitpreferred. The default is anycpu.|
|[-preferreduilang](../../../csharp/language-reference/compiler-options/preferreduilang-compiler-option.md)|Specifies the language to be used for compiler output.|
|[-recurse](../../../csharp/language-reference/compiler-options/recurse-compiler-option.md)|Includes all files in the current directory and subdirectories according to the wildcard specifications.|
|[-reference](../../../csharp/language-reference/compiler-options/reference-compiler-option.md)|References metadata from the specified assembly files.|
|[-pdb](pdb-compiler-option.md)|Specifies the file name and location of the .pdb file.|
|[-platform](platform-compiler-option.md)|Limits which platforms this code can run on: x86, Itanium, x64, anycpu, or anycpu32bitpreferred. The default is anycpu.|
|[-preferreduilang](preferreduilang-compiler-option.md)|Specifies the language to be used for compiler output.|
|[-recurse](recurse-compiler-option.md)|Includes all files in the current directory and subdirectories according to the wildcard specifications.|
|[-reference](reference-compiler-option.md)|References metadata from the specified assembly files.|
|[-refout](refout-compiler-option.md)|Generate a reference assembly in addition to the primary assembly.|
|[-refonly](refonly-compiler-option.md)|Generate a reference assembly instead of a primary assembly.|
|[-resource](../../../csharp/language-reference/compiler-options/resource-compiler-option.md)|Embeds the specified resource.|
|[-resource](resource-compiler-option.md)|Embeds the specified resource.|
|-ruleset:\<file>|Specify a ruleset file that disables specific diagnostics.|
|[-subsystemversion](../../../csharp/language-reference/compiler-options/subsystemversion-compiler-option.md)|Specifies the minimum version of the subsystem that the executable file can use.|
|[-target](../../../csharp/language-reference/compiler-options/target-compiler-option.md)|Specifies the format of the output file by using one of four options: [-target:appcontainerexe](../../../csharp/language-reference/compiler-options/target-appcontainerexe-compiler-option.md), [-target:exe](../../../csharp/language-reference/compiler-options/target-exe-compiler-option.md), [-target:library](../../../csharp/language-reference/compiler-options/target-library-compiler-option.md), [-target:module](../../../csharp/language-reference/compiler-options/target-module-compiler-option.md), [-target:winexe](../../../csharp/language-reference/compiler-options/target-winexe-compiler-option.md), [-target:winmdobj](../../../csharp/language-reference/compiler-options/target-winmdobj-compiler-option.md).|
|[-unsafe](../../../csharp/language-reference/compiler-options/unsafe-compiler-option.md)|Allows [unsafe](../../../csharp/language-reference/keywords/unsafe.md) code.|
|[-utf8output](../../../csharp/language-reference/compiler-options/utf8output-compiler-option.md)|Outputs compiler messages in UTF-8 encoding.|
|[-warn](../../../csharp/language-reference/compiler-options/warn-compiler-option.md)|Sets the warning level (0-4).|
|[-warnaserror](../../../csharp/language-reference/compiler-options/warnaserror-compiler-option.md)|Reports specific warnings as errors.|
|[-win32icon](../../../csharp/language-reference/compiler-options/win32icon-compiler-option.md)|Uses this icon for the output.|
|[-win32manifest](../../../csharp/language-reference/compiler-options/win32manifest-compiler-option.md)|Specifies a custom win32 manifest file.|
|[-win32res](../../../csharp/language-reference/compiler-options/win32res-compiler-option.md)|Specifies the win32 resource file (.res).|
|[-subsystemversion](subsystemversion-compiler-option.md)|Specifies the minimum version of the subsystem that the executable file can use.|
|[-target](target-compiler-option.md)|Specifies the format of the output file by using one of four options: [-target:appcontainerexe](target-appcontainerexe-compiler-option.md), [-target:exe](target-exe-compiler-option.md), [-target:library](target-library-compiler-option.md), [-target:module](target-module-compiler-option.md), [-target:winexe](target-winexe-compiler-option.md), [-target:winmdobj](target-winmdobj-compiler-option.md).|
|[-unsafe](unsafe-compiler-option.md)|Allows [unsafe](../../../csharp/language-reference/keywords/unsafe.md) code.|
|[-utf8output](utf8output-compiler-option.md)|Outputs compiler messages in UTF-8 encoding.|
|[-warn](warn-compiler-option.md)|Sets the warning level (0-4).|
|[-warnaserror](warnaserror-compiler-option.md)|Reports specific warnings as errors.|
|[-win32icon](win32icon-compiler-option.md)|Uses this icon for the output.|
|[-win32manifest](win32manifest-compiler-option.md)|Specifies a custom win32 manifest file.|
|[-win32res](win32res-compiler-option.md)|Specifies the win32 resource file (.res).|

## See Also
[C# Compiler Options](../../../csharp/language-reference/compiler-options/index.md)
[C# Compiler Options Listed by Category](../../../csharp/language-reference/compiler-options/listed-by-category.md)
[How to: Set Environment Variables for the Visual Studio Command Line](../../../csharp/language-reference/compiler-options/how-to-set-environment-variables-for-the-visual-studio-command-line.md)
[C# Compiler Options](index.md)
[C# Compiler Options Listed by Category](listed-by-category.md)
[How to: Set Environment Variables for the Visual Studio Command Line](how-to-set-environment-variables-for-the-visual-studio-command-line.md)
[\<compiler> Element](../../../framework/configure-apps/file-schema/compiler/compiler-element.md)
Loading