Login | Sign Up
ErrorKey - Search engine for Error codes and messages     
  C# .Net:C# .Net Compiler Errors and Warnings  [ 899 result(s) ]
MICROSOFT 
  Compiler Error CS1548  -  MICROSOFT
Cryptographic failure while signing assembly 'assembly' — 'reason' CS1548 occurs when assembly signing fails. This is usually due to an invalid key file name, an invalid key file path, or a corrupt key file. To fully sign an assembly, you must provide a valid key file that contains information about the public and private keys. To delay sign an assembly, you must select the Delay sign only check box and provide a valid key file that contains information about the public key information. The private key is not necessary when an assembly is delay-signed. For more information, see How to: Sign an Assembly (Visual Studio), /keyfile (Specify Strong Name Key File) (C# Compiler Options) and /delaysign (Delay Sign the Assembly) (C# Compiler Options). When creating an assembly, the C# compiler calls into a utility called al.exe. If there is a failure in the assembly creation, the reason for the failure is reported by al.exe. See Al.exe Tool Errors and Warnings and search that topic for the text reported by the compiler in 'reason'.
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0167  -  MICROSOFT
The delegate 'delegate' is missing the Invoke method You imported and used a managed program (one that uses the .NET Framework common language runtime) that was created with another compiler. That compiler allowed an ill-formed delegate. Therefore, the Invoke method was not available. For more information, see Delegates (C# Programming Guide).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0148  -  MICROSOFT
The delegate 'delegate' does not have a valid constructor You imported and used a managed program (one that uses the .NET Framework common language runtime) that was created with another compiler. That compiler allowed an ill-formed delegate constructor. For more information, see Delegates (C# Programming Guide).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0734  -  MICROSOFT
The /moduleassemblyname option may only be specified when building a target type of 'module' The compiler option /moduleassemblyname should only be used when building a .netmodule. See /moduleassemblyname (Specify Friend Assembly for Module) (C# Compiler Option) for more information. For more information on building a .netmodule, see /target:module (Create Module to Add to Assembly) (C# Compiler Options). Example The following sample generates CS0734. To resolve, add /target:module to the compilation. // CS0734.cs // compile with: /moduleassemblyname:A // CS0734 expected public class Test {}
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0246 Updated: July 2008  -  MICROSOFT
The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?) A type was not found. You may have forgotten to reference (/reference) the assembly that contains the type or you may not have correctly qualified its use with the using directive. There are several reasons for this error: The name of the type or namespace you are trying to use may be misspelled (including the correct case). Without the correct name the compiler is unable to find the definition for the type or namespace you have referred to in your code. This occurs most often because C# is case-sensitive and the correct casing has not been used when referring to the type. For example, Dataset ds; will generate CS0246; notice the s in Dataset is not capitalized. If the error is for a namespace name, you may not have referenced (/reference) the assembly containing the namespace. For example, your code might contain using Accessibility;. However, if your project doesn't reference the assembly Accessibility.dll then you will get CS0246. See Add Reference Dialog Box for information on how to add a reference in the development environment. If the error is for a type name, you may not have the proper using directive, or you have not fully qualified the name of the type. Consider the following line of code: DataSet ds;. To be able to use the DataSet type you would need to do two things. First, you need
d a reference to the assembly that contains the definition for the DataSet type. Second, you need a using directive for the namespace where DataSet is located. For example, because DataSet is located in the System.Data namespace, you would need the following statement at the beginning of your code: using System.Data;. The second step is not required. However, if you omitted this step then it would require that you fully qualify the DataSet type when referring to it. Fully qualifying it means that you use the namespace and type each time you refer to it in your code. So, if you decided to skip the second step you would need to change your declaration code above to: System.Data.DataSet ds;. If the error is for a non-type, you may have used a variable or something else when a type was expected. For example, in the is statement, if you use a Type object rather than an actual type, you will get this error. If you use a using alias directive and do not fully qualify the type name, this error is generated. A using alias directive does not use other using directives in the source code file to resolve types. For example, the following code generates CS0246 because the type List is not fully qualified, even though a using directive for System.Collections.Generic is present: using System.Collections.Generic; // Generates CS0246: using myAliasName = List; // Does not generate an error: using myAliasName2 = System.Coll
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0731  -  MICROSOFT
The type forwarder for type 'type' in assembly 'assembly' causes a cycle This error can only occur with improperly formed imported metadata. It cannot occur with only C# source. Example The following sample generates CS0731. The example consists of three files: 1. Circular.IL 2. Circular2.IL 3. CS0731.cs First compile the .IL files as libraries, and then compile the .cs code referencing the two files. // Circular.il // compile with: /DLL /out=Circular.dll .assembly extern circular2 { .ver 0:0:0:0 } .assembly extern circular3 { .ver 0:0:0:0 } .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 2:0:0:0 } .assembly Circular { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .class extern forwarder Circular.Referenced.TypeForwarder { .assembly extern circular2 } .module Circular.dll // MVID: {880C2329-C915-42A0-83E9-9D10C3E6DBD0} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x04E40000 // ======== CLASS MEMBERS DECLARATION ========= .class public abstract auto ansi sealed beforefieldinit User extends [mscorlib]System.Object { .method public hidebysig static class [circular2]Circular.Referenced.TypeForwa
arder F() cil managed { .maxstack 1 newobj instance void [circular2]Circular.Referenced.TypeForwarder::.ctor() ret } } // Circular2.il // compile with: /DLL /out=Circular2.dll .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 2:0:0:0 } .assembly extern Circular { .ver 0:0:0:0 } .assembly circular2 { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } .class extern forwarder Circular.Referenced.TypeForwarder { .assembly extern Circular } .module circular2.dll // MVID: {8B3BE5C8-DBE1-49C4-BC72-DF35F0387C21} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x04E40000 // CS0731.cs // compile with: /reference:circular.dll /reference:circular2.dll // CS0731 expected class A { public static void Main() { User.F(); } }
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Warning (level 2) CS0278  -  MICROSOFT
'type' does not implement the 'pattern name' pattern. 'method name' is ambiguous with 'method name'. There are several statements in C# that rely on defined patterns, such as foreach and using. For example, foreach relies on the collection class implementing the "enumerable" pattern. CS0278 can occur if the compiler is unable to make the match due to ambiguities. For example, the "enumerable" pattern requires that there be a method called MoveNext, and your code might contain two methods called MoveNext. The compiler will attempt to find an interface to use, but it is recommended that you determine and resolve the cause of the ambiguity. For more information, see How to: Access a Collection Class with foreach (C# Programming Guide). Example The following sample generates CS0278. // CS0278.cs using System.Collections.Generic; public class myTest { public static void TestForeach(W w) where W: IEnumerable, IEnumerable { foreach (int i in w) {} // CS0278 } }
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Warning (level 3) CS0642  -  MICROSOFT
Possible mistaken empty statement A semicolon after a conditional statement may cause your code to execute differently than intended. You can use /nowarn compiler option or #pragmas warning to disable this warning; see /nowarn (Suppress Specified Warnings) (C# Compiler Options) or #pragma warning (C# Reference) for more information. The following sample generates CS0642: // CS0642.cs // compile with: /W:3 class MyClass { public static void Main() { int i; for (i = 0; i < 10; i += 1); // CS0642 semicolon intentional? { System.Console.WriteLine (i); } } }
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0202  -  MICROSOFT
foreach requires that the return type 'type' of 'type.GetEnumerator()' must have a suitable public MoveNext method and public Current property A GetEnumerator function, used to enable the use of foreach statements, cannot return a pointer or array; it must return an instance of a class that is able to act as an enumerator. The proper requirements to serve as an enumerator include a public Current property and a public MoveNext method. Note: In C# 2.0, the compiler will automatically generate Current and MoveNext for you. For more information, see the code example in Generic Interfaces (C# Programming Guide). The following sample generates CS0202: // CS0202.cs public class C1 { public int Current { get { return 0; } } public bool MoveNext () { return false; } public static implicit operator C1 (int c1) { return 0; } } public class C2 { public int Current { get { return 0; } } public bool MoveNext () { return false; } public C1[] GetEnumerator () // try the following line instead // public C1 GetEnumerator () { return null; } } public class MainClass { public static void Main () { C2 c2 = new C2(); foreach (C1 x in c2) // CS0202 { System.Console.WriteLine(x.Current); } } }
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0115  -  MICROSOFT
'function' : no suitable method found to override A method was marked as an override, but the compiler found no method to override. For more information, see override (C# Reference), and Knowing When to Use Override and New Keywords (C# Programming Guide). Example The following sample generates CS0115. You can resolve CS0115 in one of two ways: Remove the override keyword from the method in MyClass2. Use MyClass1 as a base class for MyClass2. // CS0115.cs namespace MyNamespace { abstract public class MyClass1 { public abstract int f(); } abstract public class MyClass2 { public override int f() // CS0115 { return 0; } public static void Main() { } } }
C# .Net Compiler Errors and Warnings
Comments
 
 

 
C# .Net Compiler Errors and Warnings (899)
 
  Prev   1  2  3  4  5  6  7  8  9  10  Next