Cobi
Cobi

Reputation: 130

ASP.NET Import Namespace Error in Global.asax

<%@ Import Namespace="project.name.folder"%>
<%@ Import Namespace="project" %>`

In my Projectmap exists many Projectclasses. One is called project and another is called project.name.

If i compile the ASP.NET Program it says:

the type or namespace name 'name' in namespace 'project' could not be found (are you missing a using directive or an assembly reference?)

The problem began since i changed the Programmplattform to x64. The compiler thinks that .folder is a folder from the other Project 'project' but its a folder from Project 'project.name'.

Tried Solutions:

enter image description here

Upvotes: 0

Views: 3512

Answers (1)

Juan Ignacio Cornet
Juan Ignacio Cornet

Reputation: 239

Based on your screen and your question:

  1. Check that your website project references both project.name project and project project (damn, you could have used another name here :P)
  2. Folder at the moment seems to be an empty folder, so you can't do this import: <%@ Import Namespace="project.name.folder"%> because that namespace does not exists.
  3. In my image, this is working (in my case works because I've created an item "FolderClasscs" inside folder and its namespace is Project.Name.Folder)
  4. I wouldn't suggest these names due to namespace conflicts

enter image description here

Upvotes: 2

Related Questions