我正在ASP.NET MVC2網站上工作,現在我需要添加更多項目。我現在webproject看起來是這樣的:Visual Studio 2010解決方案問題
MyProject
- MyProject
-- [MyProjects project files]
- [Solution files] (plus a webconfig)
我開始只是外賣的MyProject的,並重新命名它,這樣的結構是這樣的:
MyProject.Website
- [MyPrject.Website project files]
然後我創建了一個MyPrject文件夾,我把兩個MyProjectSite和另一個項目叫MyProject.Integration,像這樣:
MyProject
- MyProject.Website
- MyProject.Integration
然後,我開始Visual Studio 2010和創建一個空白的解決方案,這給了我以下文件結構:
MyProject
- MyProject.Solution
-- [Solution files] (no web.config)
- MyProject.Website
-- [Website project files]
- MyProject.Integration
-- [Integration project files)
當在Visual Studio 2010的樣子,我可以看到我的解決方案(MyProject的)包含兩個項目(MyProject.Website和MyPrject.Integration)。
現在我打了全部重建,並首先出現以下情況例外:
錯誤1無法加載類型「System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider」。 C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ CONFIG \ web.config中129
如果我只是重建MyProjectIntegration一切工作正常,但建築,我得到這個異常MyProject.Website時UTS。
奇怪的是,我得到一個web.config中的異常沒有放在我的項目中?
我GOOGLE了這個問題,並發現我可以在MyProject.Website行添加到我的web.config,這是它的外觀
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
的「System.Data.Entity.Design 「行加入
當這是我的沙丘再次rebuilded,然後我得到了以下異常:
錯誤1類型或命名空間名稱‘ModelViewRegisterFilter’中不存在命名空間'Biss.Views.ViewClasses'(您是否缺少程序集引用?)c:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET Files \ MyProject.website \ e0c6b507 \ 13ca6533 \ App_Web_3ri01j0f.0 .cs 178
我在做什麼錯?我只需要有一個包含這兩個項目的主要解決方案?
編輯1:請注意,在我嘗試將它們放入此解決方案之前,所有項目都運行良好。
進入這個鏈接,你會得到一個想法,http://forums.asp.net/t/1546705.aspx –
正如我所說的,我已經一派異常,我做的改變如你看到的。然而,這會產生另一個反應,我認爲這是錯誤的做法。 – Banshee