Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type or namespace name does not exist [closed]

I have a WCF Data Service project built with Visual Studio 2010, which was working fine. All of a sudden, it didn't compile anymore. It was giving me messages like:

Error 7 The type or namespace name 'Services' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) C:\U...s\Visual Studio 2010\Projects...\DataService.cs ...

Error 8 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) DependencyResolver.cs 3 14

Error 10 The type or namespace name 'Web' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)

Error 12 The type or namespace name 'DataService' could not be found (are you missing a using directive or an assembly reference?)

How can I fix it?

like image 264
Attilah Avatar asked Apr 06 '11 14:04

Attilah


People also ask

How do I fix cs0246?

There are two solutions to this error. The first is to correct the name of the namespace to match one that already exists. The second is to fix the custom namespace that was created. 1.

What is namespace error?

The Compiler Error C2039 may occur when namespace members are declared across multiple header files, and you have not included those headers in the correct order.

How to fix error CS0234?

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.


1 Answers

I have had the same problem, and I had to set the "Target Framework" of all the projects to be the same. Then it built fine. On the Project menu, click ProjectName Properties. Click the compile tab. Click Advanced Compile Options. In the Target Framework, choose your desired framework.

like image 118
Nathan Koop Avatar answered Sep 30 '22 19:09

Nathan Koop