After lot's of effort and searching, I have decided to ask the question. I have a dll which I have added in my project and after adding namespace it shows error i.e.,
Error 1 A using namespace directive can only be applied to namespaces; 'Captcha' is a type not a namespace
When I have added this dll to other project it works fine but don't know what's happening in this project. I have cleaned the solution, added the dll and reference again but still the same error.
Edit:- ddl
After removing the dll I have typed cap but Intellisense shows nothing regarding captcha.
even after reading the comments, I'm pretty sure that you have a type called Captcha hiding somewhere.
You could try the object explorer, or checking inside the other dlls you have referenced (the fact that Captcha.dll works for other projects could hint you about which dll to check first).
But the message VS is giving you is pretty clear: you DO HAVE a type Captcha somewhere. I found that this is a case in which Intellisense keeps working even if the compiler is complaining.
I hope to put you in the right track.
Good luck!
Edit: just to clarify. A type can be a class, a struct or an enum.
Edit2: I just noticed you have the bin folder included in your project. Well, that is usually a really bad idea. The bin folder should be excluded from the project (right click, then "Exclude folder from project"). Then you should check your references. Just to be sure, remove all of them, and clean empty the bin folder too. Then reference the dlls through nuget or browsing to a lib folder. If you have files in the bin folder, "bad things do happen".
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