Login | Sign Up
ErrorKey - Search engine for Error codes and messages     
  HTTP:C# .Net Compiler Errors and Warnings  [ 13 result(s) ]
MICROSOFT 
  Compiler Error CS0165 Updated: July 2008  -  MICROSOFT
Use of unassigned local variable 'name' The C# compiler does not allow the use of uninitialized variables. If the compiler detects the use of a variable that might not have been initialized, it generates CS0165. For more information, see Fields (C# Programming Guide). Note that this error is generated when the compiler encounters a construct that might result in the use of an unassigned variable, even if your particular code does not. This avoids the necessity of overly-complex rules for definite assignment. If you encounter this error For more information, see http://blogs.msdn.com/ericlippert/archive/2006/08/18/706398.aspx. Example The following sample generates CS0165: // CS0165.cs using System; class MyClass { public int i; } class MyClass2 { public static void Main(string [] args) { int i, j; if (args[0] == "test") { i = 0; } /* // to resolve, either initialize the variables when declared // or provide for logic to initialize them, as follows: else { i = 1; } */ j = i; // CS0165, i might be uninitialized MyClass myClass; myClass.i = 0; // CS0165 // use new as follows // MyClass myClass = new MyClass(); // myClass.i = 0; } } The following code produces CS0165 in Visual Studio 2008 but not in Visual Studio 2005: //cs0165_2.cs class Program { public static i
int Main() { int i1, i2, i3, i4, i5; // this is an error, because 'as' is an operator // that is not permitted in a constant expression. if (null as object == null) i1 = 1; // this is an error, because 'is' is an operator that // is not permitted in a constant expression. // warning CS0184: The given expression is never of the provided ('object') type if (!(null is object)) i2 = 1; // this is an error, because a variable j3 is not // permitted in a constant expression. int j3 = 0; if ((0 == j3 * 0) && (0 == 0 * j3)) i3 = 1; // this is an error, because a variable j4 is not // permitted in a constant expression. int j4 = 0; if ((0 == (j4 & 0)) && (0 == (0 & j4))) i4 = 1; // this might be an error, because a variable j5 is not // permitted in a constant expression. // warning CS1718: Comparison made to same variable; did you mean to compare something else? int? j5 = 1; if (j5 == j5) i5 = 1; System.Console.WriteLine("{0}{1}{2}{3}{4}{5}", i1, i2, i3, i4, i5); //CS0165 return 1; } } This error occurs in recursive delegate definitions and can be avoided by defining the delegate in two statements: class Program { delegate void Del(); static void Main(string
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0034  -  MICROSOFT
Operator 'operator' is ambiguous on operands of type 'type1' and 'type2' An operator was used on two objects and the compiler found more than one conversion. Because conversions have to be unique, you either have to make a cast or to make one of the conversions explicit. For more information, see Conversion Operators (C# Programming Guide) (http://msdn.microsoft.com/en-us/library/09479473.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0006  -  MICROSOFT
Metadata file 'dll_name' could not be found The program was compiled and explicitly passed the name of a file that contained metadata; however, the .dll was not found. For more information, see /reference (Import Metadata) (C# Compiler Options) (http://msdn.microsoft.com/en-us/library/yabyz3h4.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0726  -  MICROSOFT
'format specifier' is not a valid format specifier This error occurs in the debugger. When you type a variable name into one of the debugger windows, you can follow it with a comma, and then a format specifier. Examples are: myInt, h or myString,nq. This error arises when the compiler does not recognize the Format Specifiers in C# (http://msdn.microsoft.com/en-us/library/e514eeby.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Warning (level 1) CS1685  -  MICROSOFT
The predefined type 'System.type name' is defined in multiple assemblies in the global alias; using definition from 'File Name' This error occurs when a predefined system type such as System.int32 is found in two assemblies. One way this can happen is if you are referencing mscorlib from two different places, such as trying to run the.Net Framework versions 1.0 and 1.1 side-by-side. The compiler will use the definition from only one of the assemblies. The compiler searches only global aliases, does not search libraries defined /reference. If you have specified /nostdlib, the compiler will search for Object, and in the future start all searches for predefined types in the file where it found Object (http://msdn.microsoft.com/en-us/library/system.object.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Warning (level 1) CS1607  -  MICROSOFT
Assembly generation -- reason A warning was generated from the assembly-creation phase of the compilation. If you are building a 64-bit application on a 32-bit operating system, you must ensure that 64-bit versions of all referenced assemblies are installed on the target operating system. All x86-specific common language runtime (CLR) assemblies have 64-bit counterparts (every CLR assembly will exist on all operating systems). Therefore, you can safely ignore CS1607 for CLR assemblies. You can ignore this warning if you encounter it when you create a AssemblyInformationalVersionAttribute. The informational version is a string that attaches additional version information to an assembly; this information is not used at run time. Although you can specify any text, a warning message appears on compilation if the string is not in the format that is used by the assembly version number, or if it is in that format but contains wildcard characters. This warning is harmless. For more information, see Al.exe Tool Errors and Warnings (http://msdn.microsoft.com/en-us/library/kchwc1f1.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Warning (level 1) CS3013  -  MICROSOFT
Added modules must be marked with the CLSCompliant attribute to match the assembly A module that was compiled with the /target:module compiler option was added to a compilation with /addmodule. However, the module's compliance with the Common Language Specification (CLS) does not agree with the CLS state of the current compilation. CLS compliance is indicated with the module attribute. For example, [module:CLSCompliant(true)] indicates that the module is CLS compliant, and [module:CLSCompliant(false)] indicates that the module is not CLS compliant. The default is [module:CLSCompliant(false)]. For more information on the CLS, see Common Language Specification (http://msdn.microsoft.com/en-us/library/12a7a7h3.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS0005  -  MICROSOFT
Compiler option 'compiler_option' must be followed by an argument Some compiler options require parameters. If you do not pass the arguments required by the compiler option, CS0005 is generated. For more information, see C# Compiler Options (http://msdn.microsoft.com/en-us/library/2fdbz5xd.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS2003  -  MICROSOFT
Response file 'file' included multiple times A response file was passed to the compiler more than once. A response file can only be passed to the compiler once per output file. For more on response files, see @ (Specify Response File) (http://msdn.microsoft.com/en-us/library/8a1fs1tb.aspx).
C# .Net Compiler Errors and Warnings
Comments
 
  Compiler Error CS1016  -  MICROSOFT
Named attribute argument expected Unnamed attribute arguments must appear before the named arguments. Example The following sample generates CS1016: // CS1016.cs using System; [AttributeUsage(AttributeTargets.Class)] public class HelpAttribute : Attribute { public HelpAttribute(string url) // url is a positional parameter { m_url = url; } public string Topic = null; // Topic is a named parameter private string m_url = null; } [HelpAttribute(Topic="Samples", "http://intranet/inhouse")] // CS1016 // try the following line instead //[HelpAttribute("http://intranet/inhouse", Topic="Samples")] public class MainClass { public static void Main () { } }
C# .Net Compiler Errors and Warnings
Comments
 
 

 
C# .Net Compiler Errors and Warnings (13)
 
  Prev   1  2  Next