High-Performance Development - C#, VB, SQL, ASP.NET

Slogan Text

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:

  1. Create a WCF Service project. Add your code. Set name to PrimeNumberTester.
  2. Create a test project.
  3. Right-click test project and select Add Service Reference.
  4. Enter "PrimeNumberTester" in Namespace text box at bottom of dialog.
  5. Click on OK.
  6. 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.