4

我正在使用 Visual Studio 2012 Express for Web。

当我尝试添加视图时,我收到一条错误消息:

The templates had the following 1 error(s)

C:\Program Files\Microsoft Visual Studio
11.0\Common7\IDE\VWExpress\ItemTemplates\CSharp\Web\MV
C 3\CodeTemplates\AddView\CSHTML\Empty.tt(-1,-1): error :
There was a problem getting an AppDomain to run the
transformation from the host.  The process cannot continue.

我一直在插入 Ninject(这实际上只是一个证明它正在工作的应用程序),因此它可能与其中一个启动文件有关。

我从哪里开始尝试解决这个问题?

谢谢

戴夫

4

2 回答 2

4

尝试重新启动 Visual Studio 2012 并立即添加一个视图,这应该对您有用。

您是否复制了Code Templates项目的文件夹?

于 2013-02-03T04:09:35.793 回答
1

重新启动对我不起作用。事实证明,mvc3 从未安装在我的机器上(mvc4 已经到位),而且我的 Visual Studio 副本也想安装 Service Pack 1。所以我使用控制面板重新启动了 Visual Studio,卸载了新版本的 newget。服务包 (sp1) 已成功安装。现在我的自定义 .tt 文件成功呈现新视图。

引导我走这条路的信息:

http://forums.asp.net/t/1820254.aspx?MVC+Add+View+Model+Controller+from+template+throws+an+error

http://forums.asp.net/t/1729674.aspx?Installing+MVC3+after+Installing+MVC4

于 2014-12-02T21:13:25.850 回答