MarzSocks
MarzSocks

Reputation: 4318

Referenced namespace not being recognized

I cant get the namespace system.runtime.caching to be recognized despite adding the reference. Based on research to similar problems, I've checked the target framework and all seems in order (currently 4.5.2).

Has anyone got a suggestion on how to solve this?

enter image description here

enter image description here

Upvotes: 1

Views: 107

Answers (3)

user3723271
user3723271

Reputation:

Have you tried restarting Visual Studio? I added the reference and I was able to use it as a namespace.

Upvotes: 0

Arturo Menchaca
Arturo Menchaca

Reputation: 15982

Probably the problem is you are putting your code in App_Code folder. Files in this folder are treated as content by default. You can solve this issue setting Build Action to Compile for .cs files in this folder.

However, you shouldn't use this folder for code, it will surely cause problems. I recommend you to move your code to another folder Infrastructure or Code.

Upvotes: 1

Related Questions