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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/csharp/misc/compiler-warning-cs3024.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Constraint type 'type' is not CLS-compliant.
## Example
The following example generates CS3024 in several locations:

```
```csharp
// cs3024.cs
// Compile with: /target:library
[assembly: System.CLSCompliant(true)]
Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/misc/cs0011.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The base class or interface 'class' in assembly 'assembly' referenced by type 't

## Example

```
```csharp
// CS0011_1.cs
// compile with: /target:library

Expand Down Expand Up @@ -57,7 +57,7 @@ public class Outer {}

The following sample generates CS0011.

```
```csharp
// CS0011_4.cs
// compile with: /reference:CS0011_1.dll /reference:CS0011_2.dll
// CS0011 expected
Expand Down
6 changes: 3 additions & 3 deletions docs/csharp/misc/cs0012.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ The type 'type' is defined in an assembly that is not referenced. You must add a

The following sequence of compilations will result in CS0012:

```
```csharp
// cs0012a.cs
// compile with: /target:library
public class A {}
```

Then:

```
```csharp
// cs0012b.cs
// compile with: /target:library /reference:cs0012a.dll
public class B
Expand All @@ -43,7 +43,7 @@ public class B

Then:

```
```csharp
// cs0012c.cs
// compile with: /reference:cs0012b.dll
class C
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0017.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Program 'output file name' has more than one entry point defined. Compile with /

The following sample generates CS0017:

```
```csharp
// CS0017.cs
// compile with: /target:exe
public class clx
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0020.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Division by constant zero

The following sample generates CS0020:

```
```csharp
// CS0020.cs
namespace x
{
Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/misc/cs0021.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Cannot apply indexing with [] to an expression of type 'type'
## Example
This file compiles to a .dll file—with the `DefaultMember` attribute commented out—in order to generate the error.

```
```cpp
// CPP0021.cpp
// compile with: /clr /LD
using namespace System::Reflection;
Expand All @@ -44,7 +44,7 @@ public ref class MyClassMC
## Example
The following is the C# file that calls the .dll file. This file attempts to access the class via an indexer, but because no member was declared as the default indexer to be used, the error is generated.

```
```csharp
// CS0021.cs
// compile with: /reference:CPP0021.dll
public class MyClass
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0022.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Wrong number of indices inside [], expected 'number'
## Example
The following sample generates CS0022:

```
```csharp
// CS0022.cs
public class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0023.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Operator 'operator' cannot be applied to operand of type 'type'

The following sample generates CS0023:

```
```csharp
// CS0023.cs
namespace x
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0026.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Keyword 'this' is not valid in a static property, static method, or static field
## Example
The following example generates CS0026:

```
```csharp
// CS0026.cs
public class A
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0027.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Keyword 'this' is not available in the current context

The following example generates CS0027:

```
```csharp
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0028.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0028:

```
```csharp
// CS0028.cs
// compile with: /W:4 /warnaserror
public class a
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0030.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Cannot convert type 'type' to 'type'

The following sample generates CS0030:

```
```csharp
// CS0030.cs
namespace x
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0031.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Constant value 'value' cannot be converted to a 'type'. (use 'unchecked' syntax

The following sample generates CS0031 in both checked and unchecked contexts:

```
```csharp
// CS0031.cs
namespace CS0031
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0035.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Operator 'operator' is ambiguous on an operand of type 'type'

The following sample generates CS0035:

```
```csharp
// CS0035.cs
class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0036.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ An out parameter cannot have the '[In]' attribute

The following sample generates CS0036:

```
```csharp
// CS0036.cs

using System;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0037.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Cannot convert null to 'type' because it is a non-nullable value type

The following sample generates CS0037:

```
```csharp
// CS0037.cs
public struct s
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0053.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: property type 'type' is less accessible than propert

The following sample generates CS0053:

```
```csharp
// CS0053.cs
class MyClass //defaults to private accessibility
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0054.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: indexer return type 'type' is less accessible than i

The following sample generates CS0054:

```
```csharp
// CS0054.cs
class MyClass
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0055.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: parameter type 'type' is less accessible than indexe

The following sample generates CS0055:

```
```csharp
// CS0055.cs
class MyClass //defaults to private accessibility
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0056.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: return type 'type' is less accessible than operator

The following sample generates CS0056:

```
```csharp
// CS0056.cs
class MyClass
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0057.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: parameter type 'type' is less accessible than operat

The following sample generates CS0057:

```
```csharp
// CS0057.cs
class MyClass //defaults to private accessibility
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0058.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: return type 'type' is less accessible than delegate

The following sample generates CS0058 because no access modifier is applied to MyClass and therefore it is given private accessibility by default:

```
```csharp
// CS0058.cs
class MyClass
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0059.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Inconsistent accessibility: parameter type 'type' is less accessible than delega
## Example
The following sample generates CS0059:

```
```csharp
// CS0059.cs
class MyClass //defaults to private accessibility
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0060.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Inconsistent accessibility: base class 'class1' is less accessible than class 'c

The following sample generates CS0060:

```
```csharp
// CS0060.cs
class MyClass
// try the following line instead
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0061.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Inconsistent accessibility: base interface 'interface 1' is less accessible than

The following sample generates CS0061.

```
```csharp
// CS0061.cs
// compile with: /target:library
internal interface A {}
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0065.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0065:

```
```csharp
// CS0065.cs
using System;
public delegate void Eventhandler(object sender, int e);
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0066.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0066:

```
```csharp
// CS0066.cs
using System;

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0067.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The event 'event' is never used

The following sample generates CS0067:

```
```csharp
// CS0067.cs
// compile with: /W:3
using System;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0068.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0068:

```
```csharp
// CS0068.cs

delegate void MyDelegate();
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0069.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ An event in an interface cannot have add or remove accessors

The following sample generates CS0069:

```
```csharp
// CS0069.cs
// compile with: /target:library

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0070.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The event 'event' can only appear on the left hand side of += or -= (except when

The following sample generates CS0070:

```
```csharp
// CS0070.cs
using System;
public delegate void EventHandler();
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0072.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0072:

```
```csharp
// CS0072.cs
delegate void MyDelegate();

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0073.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ An add or remove accessor must have a body

The following sample generates CS0073:

```
```csharp
// CS0073.cs
delegate void del();

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0074.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0074:

```
```csharp
// CS0074.cs
delegate void D();

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0075.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To cast a negative value, you must enclose the value in parentheses

The following code generates CS0075:

```
```csharp
// CS0075
namespace MyNamespace
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0077.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The as operator must be used with a reference type or nullable type ('int' is a

The following sample generates CS0077:

```
```csharp
// CS0077.cs
using System;

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0078.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The 'l' suffix is easily confused with the digit '1' -- use 'L' for clarity

The following sample generates CS0078:

```
```csharp
// CS0078.cs
// compile with: /W:4
class test {
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0079.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The event 'event' can only appear on the left hand side of += or -=

The following sample generates CS0079:

```
```csharp
// CS0079.cs
using System;

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0080.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Constraints are not allowed on non-generic declarations

The following sample generates CS0080 because MyClass is not a generic class and Foo is not a generic method.

```
```csharp
namespace MyNamespace
{
public class MyClass where MyClass : System.IDisposable // CS0080 //the following line shows an example of correct syntax
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0081.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Type parameter declaration must be an identifier not a type

When you declare a generic method or type, specify the type parameter as an identifier, for example "T" or "inputType". When client code calls the method, it supplies the type, which replaces each occurrence of the identifier in the method or class body. For more information, see [Generic Type Parameters](../../csharp/programming-guide/generics/generic-type-parameters.md).

```
```csharp
// CS0081.cs
class MyClass
{
Expand Down
Loading