1

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?
AlvaroAV
  • 10,335
  • 12
  • 60
  • 91
Richard Gray
  • 149
  • 2
  • 11

2 Answers2

1

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

Aishu
  • 413
  • 1
  • 5
  • 20
  • Its back again! I checked the permission and they are all fine. I dont know whats going on?! – Richard Gray Nov 13 '14 at 21:51
  • In Visual Studio, select "Clean Solution" option and then rebuild the solution again. Hope you have reference to the project instead of ref. to DLL file. – Aishu Nov 14 '14 at 14:06
1

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.

Richard Gray
  • 149
  • 2
  • 11
  • 1
    You might want to check the Build Action for those classes. I copied a bunch of classes from one project to another, and I would get the message about the type not existing. After reading your answer, I checked the Build Action and it was set to "Content". Changing it to "Compile" fixed the problem immediately. – Neil T. Dec 24 '14 at 17:44