Namespaces not recognized though they exist in VS 2010 - c#

In the C# VS2010 Solution I'm working in, there is a namespace called: EBI.Core.Base.Constant.EBISystem
That namespace's DLL is referenced as a Project (i.e. a project native to the solution,) in a different project in the same solution.
VS shows error saying that: The type of namespace Base does not exist. This is true, it does not exist because the actual name is the full namespace name above.
When I remove the project reference and add it back in, the error goes away and the full namespace name is recognized, but as soon as I build, the error comes back. Same thing happens if I close the solution and re-open it, no error, until I build.
This error seems to be happening only on my dev machine and no one else's with the same exact solution.
I looked at my GAC and there's no stray or missing dll there. I have closed and restarted the solution, I have restarted my machine to no avail. Also checked project build dependencies and they are correct. Unloaded and released the project, still the same thing.
Both the project being worked on and the referenced project are .Net 3.5.
Wondering if anyone has any suggestions. I've tried everything here: Getting "type or namespace name could not be found" but everything seems ok?

Use the same target framework version for your project and the library "EBI.Core.Base.Constant.EBISystem"

Related

visual studio analyser reports false errors in C# code

The code compiles fine but the standard Analysers of Visual Studio is reporting a lot of errors. e.g.:
using cleverDev.WpfUtils.WPF;
Error reported:
Type or Namespace name 'WpfUtils' does not exist in namespace cleverDev
But everything is fine. The Namespace exists, the code is compiled fine and also resharper finds the namespace.
The reference (Project Reference) bringing in the namespace is also working fine in other solutions.
I already tried to delete the reference and recreate it, bring it in in different ways, Rebuild a couple of times, nothing helps.
Commend of #Heinzi included the solution.
I deleted the complete .vs folder of this solution an the problem was gone.

WPF error : The name does not exist in the namespace

I'm getting this problem building a WPF project
The name does not exist in the namespace
Everything I’ve looked at says you should
Change the namespace and the project name, build, change them back
Change the build from 86 to 64, build, and back Tried removing the
reference and letting ReSharper re-instate the reference Tried
excluding the file, build, then include the file again
None of the above worked.
I have checked that each referenced class has only one instance of it throughout the whole solution – ruling out named duplicates
The references in question are all references within the one DLL – all namespaces within this dll so it’s not like there is a cross dll issue of any sort.
Your thoughts or suggestions at this point are appreciated.
I to assume that You have this error in XAML file.
I thing it is very common problem with WPF and Visual Studio 2015.For example I have this error when I use DevExpress dlls
My suggestions is to try this:
Restart Visual Studio - it is weird but frequently it works. I don't now way it works.
Use F5 and run the program instead of build them (F6). Sometimes when You compile app the error disappear and app runs. It is also weird, but in my case it works
This not resolve the problem but it helps exclude the problem with IDE

I am *not* missing an assembly or reference

I'm using Visual Studio 2013, and I'm getting an error in my C# code that I can't figure out. I'm working with the Microsoft Kinect SDK, but I'll keep it general.
I downloaded the SDK, and I can get the included sample programs to build and run. But when I try to use the code in my own project, I get the
Type or namespace name 'Kinect' does not exist in the namespace 'Microsoft' (Are you missing an assembly reference)
error.
The thing is, I'm not missing an assembly or reference. I have it added to the project's references, and the path is valid. Also, the using statements at the top of the file will autocomplete to "Kinect" for me. If I start typing using Microsoft., Kinect will appear as an autocomplete option.
What are the steps to debugging an error such as this? Could it be a 32/64 bit issue? I tried using Dependency Walker to look at the Kinect DLL, and while it throws some errors (Error: Modules with different CPU types were found.), it doesn't show any issues that I don't see with other DLLs that I'm using successfully.
What are some other potential issues that might cause a problem with DLLs not being recognized?
1 - Try going to your project settings and verify the version of the .NET framework it uses.
The best to do is to choose the same version as the external libraries.
If it's a client profile, it will very often bring that exact problem. (I'm not sure what the client profile is, but I ended up never using it...)
2 - Check if any of your references got an exclamation mark.

Type or namespace name does not exist in the namespace - yet the namespaces do exist

A project that I've been working on for a long time without any problems suddenly started throwing errors such as
The type or namespace name 'xxx' does not exist in the namespace 'yyy' (are you missing an assembly reference)?
In this case, the namespaces were all core .Net libraries such as System.Data, Linq, and IO that I've been using without any problems.
I've worked through all of the issues in this question such as making sure all the projects in the workspace are using the same version of .Net for the Target Framework setting.
I removed all the libraries in question and re-added them but the problem persisted. I doubt they libraries themselves are corrupted as I reference them in other projects within the solution.
After rolling back through my work with TFS I managed to work out what I'd done that had created this error: I'd added a folder called "System" to my project and put a class file in it.
This is an easy issue to reproduce: create a project, add a folder called system to it (it will still compile at this point) and then create a .cs file in it, that's when all the fun errors will occur.
The problem stems from the name of the "System" folder which leads to any files created in it being under the namespace ".System".
I can understand why having a folder / namespace called "System" would cause problems now but I think it would help if Visual Studio warned when creating a folder / namespace of such a name to stop this problem happening in the first place. I've logged a bug with MS, at least having this logged might help any other people who have made the same mistake as me!
I had the same issue after my system shut down unexpectedly and even though VS tried to restore, the problem popped up.
I had two projects in my Solution Explorer. To solve this, I right-clicked the project that was associated with the error message and selected 'Build'.
After that, the issue was resolved.
Just to add that the problem was permanently solved after I added a reference to the 'project' from the other 'project'.
I renamed the namespace of the file I was referencing from myproject.shared.constants to myproject.SOMETHING.shared.constants
After that It suggested "use myproject.SOMETHING.shared.constants" as suggestion. I renamed it back to myproject.shared.constants and then it worked.
Try to Clean and Then Rebuild the dll file .I was experiencing the same problem tried different suggestions from internet but none of them work.But it will. In case you don't know how follow these steps:
open your dll project file.
2.click on solution Explorer Right click on Your Dll Project Name you will find Clean and Rebuild Option.

This should not be happening. Outlook addin can't find assembly reference?? Why?

I can not work this out. I have a class library called 'ABC.Service'. In this class library I have referenced other projects from my solution.
In my 'ABC.Service' I have consistently named my classes namespace 'ABC.Service'.
I have made a project reference to this 'ABC.Service' and another class library called 'ABC.Entities' from a OutlookAddin project in the same solution.
For some reason the outlook addin project does not compile and outputs that 'The type or name 'Service' does not exist in the namespace 'ABC' (are you missing an assembly reference?) . However it does not complain about the 'ABC.Entities' classes???
The 'ABC.Service' compiles just fine and can be referenced successfully from a Windows project in the same solution which compiles just fine.
In the outlook addin intellisense can detect the namespace and class just fine also
I am obviously not missing the reference so the error message is so misleading.
I have tried;
Cleaning project/solution
Shutting down VS2010
Restarting Computer
I can only see 2 possible problems (which I can not understand why they would be problems)
In the 'ABC.Service' I have a
reference to
'Micorosoft.Office.Interop.Word'
assembly.Could this be doing
something?
I have some generated code with a
namespace called 'ABC.BusinessLogic'
instead of 'ABC.Service' - removing
this generated code to see if this is
the problem would be a nightmare as
much more would need to be changed to
get it to compile and I really don't
understand why it would be a problem
Has anyone got any ideas??
Any help appreciated
I've heard of this sort of thing happening when a project's build mode gets changed to "Client Profile." You might want to check on that.

Categories

Resources