【发布时间】:2011-06-30 00:44:58
【问题描述】:
这很奇怪,
我有一个包含两个项目的解决方案...
Genesis.Domain - 是一个类库,其中包含存储库。
Genesis_0_02 - 拥有实际的 MVC 控制器、视图等...而且它是启动项目
我正在修改存储库和 mvc 项目。我能够添加几个视图,但随后自动视图生成(右键单击 +“添加视图”)停止工作。
弹出一个错误对话框,其中包含错误和堆栈跟踪。我不能复制粘贴它,但基本上它说:
C:\pathto\CodeTemplates\AddView\Empty.tt(-1,-1): error : An exception was thrown
while running the transformation code. The process cannot continue. The following
exception was thrown:
System.IO.FileNotFoundException: Could not load file or assembly 'Genesis.Domain,
Version=1.0.0.0, Culture Neutral, etc.etc.' or one of its dependencies. The system
cannot find the file specified.
File name: 'Genesis.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
后面是我无法复制粘贴的堆栈跟踪。
是什么原因造成的? Genesis.Domain 被引用并且在所有开发过程中都被引用。项目/解决方案编译良好,运行良好。
我可以使用 Genesis_0_02 命名空间中的模型/类创建视图。但不是来自 Genesis.Domain 命名空间。 (尽管 Genesis.Domain 类确实显示在列表中。)
此外,“添加视图”课程列表中还弹出了不寻常的课程。它们看起来像这样:
Genesis_0_02.Controllers.AdminMemberController+<>c__DisplayClass8+<>c__DisplayClasse>
我不知道这些是从哪里来的。
这可能是什么原因造成的?如何让“添加视图”功能再次发挥作用?
编辑
顺便说一句:我可以手动创建新视图并且它们确实有效。
【问题讨论】:
-
Genesis_0_02 项目中是否有“外部依赖项”快捷方式文件夹?如果是这样,当你双击它时会发生什么?
标签: asp.net-mvc visual-studio-2010 asp.net-mvc-2