C# Warnings
-
hi, i've got some warnings which i couldnt resolve... Could somebody pls help me with it? The list of warnings are: Warning 1 Object reference not set to an instance of an object. 0 0 Warning 2 The referenced component 'DockingToolbar' could not be found. Warning 3 The referenced component 'ImageLib.Imaging' could not be found. Warning 4 The referenced component 'ImageLib.Math' could not be found. Warning 5 The referenced component 'SourceGrid2' could not be found. Warning 6 The referenced component 'SourceLibrary' could not be found. Warning 7 The referenced component 'WeifenLuo.WinFormsUI' could not be found.
-
hi, i've got some warnings which i couldnt resolve... Could somebody pls help me with it? The list of warnings are: Warning 1 Object reference not set to an instance of an object. 0 0 Warning 2 The referenced component 'DockingToolbar' could not be found. Warning 3 The referenced component 'ImageLib.Imaging' could not be found. Warning 4 The referenced component 'ImageLib.Math' could not be found. Warning 5 The referenced component 'SourceGrid2' could not be found. Warning 6 The referenced component 'SourceLibrary' could not be found. Warning 7 The referenced component 'WeifenLuo.WinFormsUI' could not be found.
for first one that is "Warning 1 Object reference not set to an instance of an object.0 0" you may have just declaring object..... but not create instance....... for example....... suppose one class Triangle then, 1.Declare object of Triangle class
private triangleObj;
2. You may don't have do the following step before using it so just do it
triangleObj = new Triangle();
Thanks.........
-
hi, i've got some warnings which i couldnt resolve... Could somebody pls help me with it? The list of warnings are: Warning 1 Object reference not set to an instance of an object. 0 0 Warning 2 The referenced component 'DockingToolbar' could not be found. Warning 3 The referenced component 'ImageLib.Imaging' could not be found. Warning 4 The referenced component 'ImageLib.Math' could not be found. Warning 5 The referenced component 'SourceGrid2' could not be found. Warning 6 The referenced component 'SourceLibrary' could not be found. Warning 7 The referenced component 'WeifenLuo.WinFormsUI' could not be found.
When you see errors warning you that component X could not be referenced, this normally means that the application is referencing a DLL (or DLLs) that no longer exist at the path it was picked up from. To identify whether or not this is the problem, take a look at the references for your application - if there's a little yellow warning triangle on some of the references, then these are the culprits, and they will need to be dropped and readded to your project.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
hi, i've got some warnings which i couldnt resolve... Could somebody pls help me with it? The list of warnings are: Warning 1 Object reference not set to an instance of an object. 0 0 Warning 2 The referenced component 'DockingToolbar' could not be found. Warning 3 The referenced component 'ImageLib.Imaging' could not be found. Warning 4 The referenced component 'ImageLib.Math' could not be found. Warning 5 The referenced component 'SourceGrid2' could not be found. Warning 6 The referenced component 'SourceLibrary' could not be found. Warning 7 The referenced component 'WeifenLuo.WinFormsUI' could not be found.
The first thing to do is to look at each one in turn: and treat each warning as if it was an error - it probably is, and will cause other problems later when you run your code. Compile your app. Look at the error pane. Double click on the first warning - VS will take you to the line involved. The first one is obvious: you have declared a variable, but VS thinks it can see a path by which it can be used without being set first. Normally, this is because either you haven't set it at all, or there is a logic condition which sets it one of two ways, but VS thinks it might not get to one of the two. For example:
private int GetTotal(int[] values)
{
int total;
foreach(int value in count)
{
total = Sum(value);
}
return total;
}You know that values will never be empty - but VS doesn't. The other errors are harder, without knowing more. Look at each line, and try to see what VS is talking about!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
The first thing to do is to look at each one in turn: and treat each warning as if it was an error - it probably is, and will cause other problems later when you run your code. Compile your app. Look at the error pane. Double click on the first warning - VS will take you to the line involved. The first one is obvious: you have declared a variable, but VS thinks it can see a path by which it can be used without being set first. Normally, this is because either you haven't set it at all, or there is a logic condition which sets it one of two ways, but VS thinks it might not get to one of the two. For example:
private int GetTotal(int[] values)
{
int total;
foreach(int value in count)
{
total = Sum(value);
}
return total;
}You know that values will never be empty - but VS doesn't. The other errors are harder, without knowing more. Look at each line, and try to see what VS is talking about!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
Sorry to be pedantic but, strictly speaking, when you talk about VS seeing a path that can be used that's uninitialised, this is not accurate. Visual Studio doesn't care - it's just an IDE. It's the compiler that sees the path. I know that you know that VS isn't the compiler, but a lot of people seem to think it is.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Sorry to be pedantic but, strictly speaking, when you talk about VS seeing a path that can be used that's uninitialised, this is not accurate. Visual Studio doesn't care - it's just an IDE. It's the compiler that sees the path. I know that you know that VS isn't the compiler, but a lot of people seem to think it is.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
I know, I know - but I don't like to add too much new stuff for beginners: they are generally confused without me adding distinctions! :-D
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
-
The first thing to do is to look at each one in turn: and treat each warning as if it was an error - it probably is, and will cause other problems later when you run your code. Compile your app. Look at the error pane. Double click on the first warning - VS will take you to the line involved. The first one is obvious: you have declared a variable, but VS thinks it can see a path by which it can be used without being set first. Normally, this is because either you haven't set it at all, or there is a logic condition which sets it one of two ways, but VS thinks it might not get to one of the two. For example:
private int GetTotal(int[] values)
{
int total;
foreach(int value in count)
{
total = Sum(value);
}
return total;
}You know that values will never be empty - but VS doesn't. The other errors are harder, without knowing more. Look at each line, and try to see what VS is talking about!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."
Thanks everyone i got it :) cheers!!!!
-
hi, i've got some warnings which i couldnt resolve... Could somebody pls help me with it? The list of warnings are: Warning 1 Object reference not set to an instance of an object. 0 0 Warning 2 The referenced component 'DockingToolbar' could not be found. Warning 3 The referenced component 'ImageLib.Imaging' could not be found. Warning 4 The referenced component 'ImageLib.Math' could not be found. Warning 5 The referenced component 'SourceGrid2' could not be found. Warning 6 The referenced component 'SourceLibrary' could not be found. Warning 7 The referenced component 'WeifenLuo.WinFormsUI' could not be found.
Hi Paste your code snippet if you have. According to the information you provided i can guess that you are forgot to refer your dll. :doh: