Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6916391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:35:48+00:00 2026-05-27T09:35:48+00:00

I have my data model in project A, in the namespace ProjectA.Model.MyEntities . In

  • 0

I have my data model in project A, in the namespace ProjectA.Model.MyEntities . In project B (an MVC2 project), I reference project A. But when my pages are requested, they are choking saying that ‘type or namespace ProjectA is not known.

When I compile my project, I get no errors. From my controller, the database context seems to be working fine, as references to MyEntities compile fine. Going to definition on MyEntities navigates me to the Model.Designer.cs file in project A.

It’s like project A is reference during static compile, but not at run time.

This is an MVC2 project, running on .Net4, in Visual Studio 2010, using ASPX engine. It is a legacy project, that is why it is MVC2, but it has been upgraded to .Net4.

What do I have to do to get rid of this error. Have been beating my head on the wall over it all morning.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:35:49+00:00Added an answer on May 27, 2026 at 9:35 am

    You could try adding the namespace for ProjectA.Model.MyEntities to the web.config, this will inform the application that the namespace is required for all views.

    <system.web>
        <pages>
            <namespaces>
                <!-- defaults omitted for clarity-->
                <add namespace="ProjectA.Model.MyEntities" />
            </namespaces>
        </pages>
    </system.web>
    

    Alternatively, you can use an imports directive at the top of the individual views – this would be more appropriate if you are only using ProjectA’s entities within a limited number of views:

    <%@ Import Namespace="ProjectA.Model.MyEntities"%>
    

    This should be included after the @Page or @Control directive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem adding ADO.Net Entity Data Model to my existing project, or
I'm using Core data in an iOS project. I have the data model setup
I have a DAL project, with an entity data model context bound with EF
Im my iPhone project, I have a data model with 2 objects: Profile and
I have a data model which is similar to this: (in another project) ________________________________
I have a data model that includes common columns like addedBy, editedby (user), addedDate,
In a webapp, i have a data-model (let's call it Item). The data of
I have a simple data model of two tables, email and recipients, email can
I have an Entity Data Model that I have created, and its pulling in
I have made a data model, and now I've made a 2nd version. All

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.