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/cs0265.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Partial declarations of 'type' have inconsistent constraints for type parameter
## Example
In this code, the partial class definitions are all in a single file, but they could also be spread across multiple files.

```
```csharp
// CS0265.cs
public class GenericsErrors
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0267.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The partial modifier can only appear immediately before 'class', 'struct', or 'i

The following sample generates CS0267:

```
```csharp
// CS0267.cs
public partial class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0271.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The property or indexer 'property/indexer' cannot be used in this context becaus

The following example generates CS0271:

```
```csharp
// CS0271.cs
public class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0272.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The property or indexer 'property/indexer' cannot be used in this context becaus
## Example
The following example generates CS0272:

```
```csharp
// CS0272.cs
public class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0273.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The accessibility modifier of the 'property_accessor' accessor must be more rest
## Example
This sample contains an internal property with an internal set method. The following sample generates CS0273.

```
```csharp
// CS0273.cs
// compile with: /target:library
public class MyClass
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0274.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Cannot specify accessibility modifiers for both accessors of the property or ind

The following example generates CS0274:

```
```csharp
// CS0274.cs
public class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0275.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: "wiwagn"
## Example
The following example generates CS0275:

```
```csharp
// CS0275.cs
public interface MyInterface
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0276.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: "wiwagn"
## Example
The following example generates CS0276:

```
```csharp
// CS0276.cs
public class MyClass
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0277.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: "wiwagn"
## Example
The following example generates CS0277:

```
```csharp
// CS0277.cs
public interface MyInterface
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0278.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ms.author: "wiwagn"
## Example
The following sample generates CS0278.

```
```csharp
// CS0278.cs
using System.Collections.Generic;
public class myTest
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0279.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: "wiwagn"
## Example
The following example generates CS0279:

```
```csharp
// CS0279.cs

using System;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0280.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ms.author: "wiwagn"
## Example
The following sample generates CS0280.

```
```csharp
// CS0280.cs
using System;
using System.Collections;
Expand Down
6 changes: 3 additions & 3 deletions docs/csharp/misc/cs0281.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Friend access was granted to 'AssemblyName1', but the output assembly is named '

- sn -tp key.publickey

```
```csharp
// CS0281.cs
// compile with: /target:library /keyfile:CS0281.snk
public class A {}
```

## Example

```
```csharp
// CS0281_b.cs
// compile with: /target:library /keyfile:CS0281.snk /reference:CS0281.dll
[assembly:System.Runtime.CompilerServices.InternalsVisibleTo("CS0281 , PublicKey=00240000048000009400000006020000002400005253413100040000010001004b2d4d56af7c50be2fcbbf97cb880b9e73ad84467a587191fef63aadc118a96cecf9d508cd679c907b6e20f71684300bdc2c0a851019af0c96b29bf8f1339753276041aefd67db46139e6348b3a12f29537b4dc6c2c19829df2c9ed6803f3c63c3b84cfa2728849386aea575c543a5f70fa85793d2946f15f7fe1ccb0c5e8fe0")]
Expand All @@ -54,7 +54,7 @@ class B : A {}

Notice that this sample creates an output file with the same name as the output file in the first sample. To resolve, do not change the assembly attributes of the component and add class C.

```
```csharp
// CS0281_c.cs
// compile with: /target:library /out:CS0281.dll /keyfile:CS0281.snk /reference:CS0281_b.dll
// CS0281 expected
Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/misc/cs0282.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ There is no defined ordering between fields in multiple declarations of partial

`csc /targt:library cs0282_1.cs cs0282_2.cs`

```
```csharp
partial struct A
{
int i;
Expand All @@ -38,7 +38,7 @@ partial struct A
## Example
This code contains a conflicting description of the same `struct`.

```
```csharp
partial struct A
{
int j;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0283.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The type 'type' cannot be declared const
## Example
The following example generates CS0283.

```
```csharp
// CS0283.cs
struct MyTest
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0305.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Using the generic type 'generic type' requires 'number' type arguments
## Example
The following sample generates CS0305.

```
```csharp
// CS0305.cs
public class MyList<T> {}
public class MyClass<T> {}
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0306.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The type 'type' may not be used as a type argument

The following example generates CS0306:

```
```csharp
// CS0306.cs
class C<T>
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0307.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The 'construct' 'identifier' is not a generic method. If you intended an express

The following sample generates CS0307:

```
```csharp
// CS0307.cs
class C
{
Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/misc/cs0308.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The non-generic type-or-method 'identifier' cannot be used with type arguments.

The following example generates CS0308:

```
```csharp
// CS0308a.cs
class MyClass
{
Expand All @@ -37,7 +37,7 @@ class MyClass

The following example also generates CS0308. To resolve the error, use the directive "using System.Collections.Generic."

```
```csharp
// CS0308b.cs
// compile with: /t:library
using System.Collections;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0312.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The type 'type1' cannot be used as type parameter 'name' in the generic type or
## Example
The following code generates CS0312:

```
```csharp
// cs0312.cs
class Program
{
Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/misc/cs0313.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ The type 'type1' cannot be used as type parameter 'parameter name' in the generi

1. Using the code that follows as an example, one solution is to specify an ordinary `ImplStruct` as the first type argument in the call to `TestMethod`. Then modify `TestMethod` to create a nullable version of `Implstruct` in its return statement:

```
```csharp
return new Nullable<T>(t);
```

## Example
The following code generates CS0313:

```
```csharp
// cs0313.cs
public interface BaseInterface { }
public struct ImplStruct : BaseInterface { }
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0314.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The type 'type1' cannot be used as type parameter 'name' in the generic type or
## Example
The following code generates CS0314:

```
```csharp
// cs0314.cs
// Compile with: /target:library
public class ClassConstraint { }
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0315.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The type 'valueType' cannot be used as type parameter 'T' in the generic type or
## Example
The following example generates CS0315:

```
```csharp
// cs0315.cs
public class ClassConstraint { }
public struct ViolateClassConstraint { }
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0316.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The parameter name 'name' conflicts with an automatically-generated parameter na
## Example
The following code generates CS0316:

```
```csharp
// cs0316.cs
// Compile with: /target:library
public class Test
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0400.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The type or namespace name 'identifier' could not be found in the global namespa

To avoid this error, locate the declaration of the identifier, verify the correct spelling, and if the declaration is in a separate assembly, make sure that you have the appropriate assembly reference. If the identifier is declared inside another type or namespace, use the fully-qualified name after the ::. The following sample generates CS0400:

```
```csharp
// CS0400.cs
class C
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0401.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The new() constraint must be the last constraint specified
## Example
The following sample generates CS0401.

```
```csharp
// CS0401.cs
// compile with: /target:library
using System;
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0402.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ms.author: "wiwagn"

The entry point was found in a generic type. To remove this warning, implement Main in a non-generic class or struct.

```
```csharp
// CS0402.cs
// compile with: /W:4
class C<T>
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0403.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Cannot convert null to type parameter 'name' because it could be a non-nullable
## Example
The following sample generates CS0403.

```
```csharp
// CS0403.cs
// compile with: /target:library
class C<T>
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0404.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0404:

```
```csharp
// CS0404.cs
[MyAttrib<int>] // CS0404
class C
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0405.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Duplicate constraint 'constraint' for type parameter 'type parameter'

The following sample generates CS0405:

```
```csharp
// CS0405.cs
interface I
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0406.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The class type constraint 'constraint' must come before any other constraints
## Example
The following sample generates CS0406.

```
```csharp
// CS0406.cs
// compile with: /target:library
interface I {}
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0407.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: "wiwagn"
## Example
The following sample generates CS0407:

```
```csharp
// CS0407.cs
public delegate int MyDelegate();

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0409.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A constraint clause has already been specified for type parameter 'type paramete

Multiple constraint clauses (where clauses) were found for a single type parameter. Remove the extraneous where clause, or correct the where clauses so that a unique type parameter in each clause.

```
```csharp
// CS0409.cs
interface I
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0410.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ No overload for 'method' has the correct parameter and return types
## Example
The following example generates CS0410:

```
```csharp
// CS0410.cs
// compile with: /langversion:ISO-1

Expand Down
4 changes: 2 additions & 2 deletions docs/csharp/misc/cs0411.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The type arguments for method 'method' cannot be inferred from the usage. Try sp
## Example
The following sample generates CS0411:

```
```csharp
// CS0411.cs
class C
{
Expand All @@ -42,7 +42,7 @@ class C
## Example
Other possible error cases include when the parameter is `null`, which has no type information:

```
```csharp
// CS0411b.cs
class C
{
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0412.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ms.author: "wiwagn"
## Example
The following sample generates CS0412:

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

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0414.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The private field 'field' is assigned but its value is never used

The following sample shows one way in which CS0414 will be generated:

```
```csharp
// CS0414
// compile with: /W3
class C
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0416.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ms.author: "wiwagn"

The following sample generates CS0416:

```
```csharp
// CS0416.cs
public class MyAttribute : System.Attribute
{
Expand Down
Loading