This is a short blog post about a strange error when adding a WCF service reference. A WCF service was created and I wanted to add a service reference to a client project. I added the reference through Visual Studio and everything went fine until I compiled. Then I got this error:
Error 3 The type name 'ServiceReference1' does not exist in the type 'MyWorld.MyWorld' ...\Service References\ServiceReference1\Reference.cs
I found that this is caused by me having the same namespace name as class name (MyWorld.MyWorld = Namespace.ClassName). Change your namespace to a name that is not the same name as your class and this will compile.
Very good find. Saved me a lot of heartache.
ReplyDeleteExcellent, been wracking my head over this on and off for a few hours!
ReplyDeleteThanks for posting this. You solved my problem.
ReplyDeleteI love you for this.
ReplyDeleteThanks a lot for this ! :)
ReplyDeleteGreat find. Saved me major pain.
ReplyDeleteGreat find. Saved me major pain.
ReplyDeleteGreat:) Solved my problem.
ReplyDeleteGreat Work!!
ReplyDeleteAnother thank you... worked a charm!
ReplyDeleteThanks
ReplyDeleteI had been going at this for over an hour.
Thanks a lot, my pain has gone
ReplyDeleteThat was my headache, too! Thx!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for saving me lots of time, great post...
ReplyDelete--engin
thanks a lot dude..really helped me..
ReplyDeleteI want you to have my baby.
ReplyDeleteSo simple. Thank you very much for the assistance.
ReplyDeleteit's great that you wrote this post
ReplyDeleteThanks so much!
ReplyDeleteThank you for your post.
ReplyDeleteAs it happens it's relevant to WCF 4.0 too
Thanks, this helped me out a ton.
ReplyDeleteHow did you find/figure this out. I appreciate your posting it because I couldn't figure out how to make it go away.
ReplyDeleteGreat, it worked for me. All I did was rename my namespace and it fixed the error. Well said.
ReplyDeleteOMG thanks a lot, I can't believe I fell for this.
ReplyDeleteAlso a big Thank you.
ReplyDeleteThis has wasted hours of my time.