• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 667
  • Last Modified:

CS0246: The type or namespace name 'UserLoginInfo' could not be found (are you missing a using directive or an assembly reference?)

I counter this error "CS0246: The type or namespace name 'UserLoginInfo' could not be found (are you missing a using directive or an assembly reference?)" in C# .net page. I have created class UserLoginInfo.cs and put inside App_Code folder. When move the code to other server, I don't have this error, it only happens in my local notebook where I am doing program development. Please advise me
  • 2
1 Solution
select the file in App_Code, and from visual studio properties, change the action from content to compile.
scissorhandAuthor Commented:
I select the file but cant see the action option at the visual studio property, I am using visual studio 2010
right click on the file and try
Jitendra PatilSr.Software EngineerCommented:
you can do it by rightclick on the file in App_code folder => select Properties =>change Build Action to Compile

then add a  namespace reference to your calling page as

using TestWebApplication.App_code;

and use it where ever you need as below.
UserLoginInfo LGI = new UserLoginInfo();

hope this helps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now