The Type does not Exist in the namespace. Are you missing an Assembly?

1.1k views Asked by At

I have 2 C# projects first one name is "Advocar" and the second one is "Import".

There is a class in Advocar project which we need to access to that from Import project. So in Import project I added reference to Advocar.

The problem is from Import project I recognizes all the Advocar classes except the new class that I just created in the Advocar. and when I build it, it say "The Type or namespace does not exist in the Advocar.Data.Inventory namespace. Are you missing an assembly?", but the class is exist in that namespace.

I build Advocar project and re-add the assembly to the Import project and it did not help. Both project are in .NET 2.0.

  • Any Idea please?
2

There are 2 answers

2
Aishu On

Check the access level of new class added into the namespace.

1
Richard Gray On

Ok. I found the solution although I dont know what would cause that. since 40% of all the classes that I have are the same code, so to create a new class I just copied and pasted one of the existing class and made changes on that one. So to solve my issue, I deleted the new classes and I just Add New Item and create a blank class and past the code that I needed to the new class and it fixed that. Its look like some kind of caching issue that although you rename a class and so on, but it still has some record from past.