I have a C#
solution with several projects in Visual Studio 2010
. One is a test project (I'll call it "PrjTest"), the other is a Windows Forms Application
project (I'll call it "PrjForm"). There is also a third project referenced by PrjForm, which it is able to reference and use successfully.
PrjForm references PrjTest, and PrjForm has a class with a using
statement:
using PrjTest;
using
statement is correctly in placeusing PrjTest;
line with the error:The type or namespace name 'PrjTest' could not be found (are you missing a using directive or an assembly reference?)
I've tried the following to resolve this:
VS 2010
I have done my homework and spent far too long looking for an answer online, none of the solutions has helped yet.
What else could I try?
That may be it's in a different project in the current solution, in a external DLL, or just in a different namespace in another file in the current project. Start by hovering the mouse over the error, and open the drop down that appears. If it has an "include" option, click that, and it should fix it.
The following situations cause compiler error CS0246. Did you misspell the name of the type or namespace? Without the correct name, the compiler cannot find the definition for the type or namespace. This often occurs because the casing used in the name of the type is not correct.
To fix this error, simply update the example . csproj file to use a previous System. CommandLine version. Note that this package is only used to parse the options for the example.
Navigate to the startup project in solution explorer. Right click, properties > Application > Target framework. Change the target framework to anything else. Press Yes for the confirmation dialog.
See this question.
Turns out this was a client profiling issue.
PrjForm was set to ".Net Framework 4 Client Profile" I changed it to ".Net Framework 4", and now I have a successful build.
Thanks everyone! I guess it figures that after all that time spent searching online, I find the solution minutes after posting, I guess the trick is knowing the right question to ask..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With