Problem: Type <TypeName> is undefined. Reference.vb.
When you add a service reference to a Visual Studio project the Visual Studio compiler complains about undefined types in Reference.vb.
Type <PrimeNumberTester.PrimeNumberTester> is undefined. Reference.vb
Steps leading to problem:
-
Create a WCF Service project. Add your code. Set name to PrimeNumberTester.
-
Create a test project.
-
Right-click test project and select Add Service Reference.
-
Enter "PrimeNumberTester" in Namespace text box at bottom of dialog.
-
Click on OK.
-
Visual Studio generates the "Type <TypeName> is undefined." errors.
Solution: Choose different namespace
Your service reference namespace can not be the same name as the service.
In our example above we have PrimeNumberTester.PrimeNumberTester.
When you add the service reference choose a different name. Example, PrimeNumberServiceReference.