我有一個簡單的ASP.NET MVC3應用程序。在項目文件中,我已經開啓了構建MVC的視圖:
<MvcBuildViews>True</MvcBuildViews>
此外我使用實體框架4.0。我已經添加了對我的Web項目的System.Data.Entity
程序集的參考。 (是的,我知道在UI中使用數據訪問層並不好,它僅用於測試)。 在項目文件中,它看起來:
<Reference Include="System.Data.Entity" />
然後我試着使用ObjectContext類在我看來(剃刀引擎),但我得到的錯誤信息:
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'.
在我的另一項目文件我已經看到了System.Data.Entity的是其他人引用:
<Reference Include="System.Data.Entity" >
<Private>True</Private>
</Reference>
接下來,我已經改變項目文件中使用<Private>True</Private>
子元素和問題(參考部分)已經解決了。
那麼,什麼是<Private>True</Private>
以及它如何影響構建過程?