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 8413403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:55:04+00:00 2026-06-10T00:55:04+00:00

Prehistory: I have a simple ASP.NET MVC3 application. In the project file i’ve turned

  • 0

Prehistory:

I have a simple ASP.NET MVC3 application. In the project file i’ve turned on building MVC’s views :

<MvcBuildViews>True</MvcBuildViews>

Also I use Entity Framework 4.0. And I’ve added reference to the System.Data.Entity assembly to my Web project. (Yes, I know this is not good to use data access layer in the UI, it is only for test).
In project file it looks:

<Reference Include="System.Data.Entity" />

Then I’ve tried to use ObjectContext class in my View (Razor engine), but I’ve got the error message:

errorCS0012: The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

In my another project file I’ve seen that System.Data.Entity was referenced else:

<Reference Include="System.Data.Entity" >
    <Private>True</Private>
</Reference>

Next, I’ve change project file (reference section) using <Private>True</Private> child element and the problem has been resolved.

So, What is <Private>True</Private> and how it affect the build process?

  • 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-06-10T00:55:05+00:00Added an answer on June 10, 2026 at 12:55 am

    Private=True copies the assembly into the website’s “bin” folder where they automatically become part of the website’s referenced assembly dictionary.

    But you don’t want to copy framework assemblies into the bin folder. Just add the following to the web.config which resides in the “~/Views” folder:

        <system.web>
        <compilation>
            <!--add assembly references needed for MvcBuildViews build task-->
            <assemblies>
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            </assemblies>
        </compilation>
    

    If there exists a syntax which does not require to specify the full version 4.0.0.0.0 there I would be happy to be informed.

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

Sidebar

Related Questions

I have my little client application which - when started - creates some user
I'm new to OS X programming but generally liking it. I have the following
I have an IQueryable (PartHistories) that will return a set of objects. I have
I have a set of tabs which cause certain DIVs with options to 'fly
prehistory: Java regular expression for binary string I can extract a substring with binary
I've got a very strange issue while parsing an external XAML file. The pre-history
I have a Model, Customers , in which I have a list property, PayHistory
I have only one table in my mySql database for a very basic website
i am checking a sample project from github an i got this error,,in one
I am once again looking for some help. I have found this stopwords script

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.