2011-09-03 210 views
2

我正在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:请注意,在我尝试将它们放入此解决方案之前,所有项目都运行良好。

+0

进入这个链接,你会得到一个想法,http://forums.asp.net/t/1546705.aspx –

+0

正如我所说的,我已经一派异常,我做的改变如你看到的。然而,这会产生另一个反应,我认为这是错误的做法。 – Banshee

回答

1

而不是创建一个空白的解决方案,为什么不尝试从mvc解决方案模板开始,然后将现有的项目和文件添加到它。

+0

因为根据我的文章,文件结构将不正确。 – Banshee

+0

我测试了你的解决方案,并且做了一些工作,我得到了它的工作,文件结构不像我想要的那样可行(没有特殊的解决方案文件夹),但我可以忍受。然而,问题仍然存在,为什么我在我的文章中遇到问题? – Banshee

5

当我遇到这个问题时,我只是在web上的编译/程序集中添加了以下行。配置:

<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
相关问题