无法在 VS 2015 中从控制器添加视图:“运行所选代码生成器时出错" [英] Can't Add View from Controller in VS 2015 : "There was an error running the selected code generator"
问题描述
我正在关注一个视频教程,我需要使用 Visual Studio 2015
创建一个空的 ASP.NET Web
应用程序和 MVC
代码>,作为 ASP.NET 世界的新手,我正在一步一步地跟随.
I'm following a video tutorial where I'm required to create an empty ASP.NET Web
Application with MVC
, using Visual Studio 2015
, being new to ASP.NET world, I'm following step by step.
我的项目创建得很好,下一步从现有的 Controller
添加一个视图,我遇到了一个消息框错误说:
I got my project created well, next step adding a View from an existing Controller
, I got hit by a messagebox error saying :
错误:
运行所选代码生成器时出错:'无效的指针(来自 HRESULT 的异常:0x80004003(E_POINTER))'
Error :
There was an error running the selected code generator: 'Invalid pointer (Exception from HRESULT:0x80004003(E_POINTER))'
我用谷歌搜索了这个问题,发现了类似的问题,但没有一个明确的解决方案,一些类似的问题是 VisualStudio 的早期版本发布的,但正如我所说的没有一个明确的解决方案.
I Googled the problem, found similar issues, but none led to a clear solution, some similar problems were issued by anterior version of VisualStudio, but as I said none with a clear solution.
为了澄清我的经历,以下是我逐步完成的工作:
To clarify what I experienced, here's what I've done step by step :
选择一个 ASP.NET Web 应用程序:
选中 MVC 选中的空模板:
尝试从控制器Add View
:
Tried to Add View
from a Controller :
一些设置...
错误:
是什么导致了这个问题,有什么解决方法?
What's causing this problem and What is the solution for it ?
更新:
事实证明,即使尝试手动添加视图,我也会遇到同样的错误,添加视图完全不可能!
It turns out that even by trying to add the View manually I get the same error, adding a view is all ways impossible !
推荐答案
尝试清除ComponentModelCache,下次VS启动时会重建缓存.
Try clearing the ComponentModelCache, the cache will rebuild next time VS is launched.
- 关闭 Visual Studio
- 删除此文件夹中的所有内容 C:Users
[您的用户名]
AppDataLocalMicrosoftVisualStudio14.0ComponentModelCache - 重启 Visual Studio
- Close Visual Studio
- Delete everything in this folder C:Users
[your users name]
AppDataLocalMicrosoftVisualStudio14.0ComponentModelCache - Restart Visual Studio
14.0 适用于 Visual Studio 2015.这也适用于其他版本.
14.0 is for visual studio 2015. This will work for other versions also.
这篇关于无法在 VS 2015 中从控制器添加视图:“运行所选代码生成器时出错"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!