将 Asp.net mvc 添加到现有 Web 应用程序如何获取脚手架选项
我按照 Professional Asp.net 1.0 Wrox 书中的指导将 MVC 引用添加到现有的 Web 应用程序,除了脚手架选项之外,它运行良好。 当我右键单击控制器时,我没有获得在新的 ASP.NET MVC 应用程序中获得的脚手架视图选项。 我确信需要一个 .csproj hack 来获取脚手架选项,但我在任何地方都找不到任何参考。 还有其他人遇到过这个问题并找到了解决方案吗?
I followed the guidance in the Professional Asp.net 1.0 Wrox book for adding the MVC references to an exisiting web application and it works well except for the scaffolding options. When i right click a controller i do not get the scaffold view options that you get in a new asp.net mvc app. I am sure there is a .csproj hack that is needed to get the scaffold options but i can't find any references anywhere. Has anyone else run into this and found a solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,谷歌来救援。 我在以下博客中找到了答案: http://wildermuth.com/Tag/ASP.NET +MVC
您需要编辑 .csproj 文件并添加到 ProjectTypeGuids {603c0e0b-db56-11dc-be95-000d561079b0}。 顺序似乎很重要。 最初,我添加到了 guid 列表的末尾,但该项目无法加载并抛出不受支持的错误。 我创建了一个空的 mvc 站点并查看了 guid,上面的 guid 列在第一。 所以我把它添加到开头,一切正常。
Well google to the rescue. I found an answer at the following blog: http://wildermuth.com/Tag/ASP.NET+MVC
You need to edit the .csproj file and add to ProjectTypeGuids {603c0e0b-db56-11dc-be95-000d561079b0}. Order seems to matter. Originally i added to the end of the guid list and the project would not load and threw an unsupported error. I created an empty mvc site and looked at the guids and the guid above was listed 1st. So i added it to the beginning and everything worked fine.
您是否看过如何在 Global.asax 文件中注册数据上下文?
此链接可能包含更多可以提供帮助的详细信息:
http://msdn.microsoft.com/ en-us/library/system.web.dynamicdata.metamodel.registercontext.aspx
和这个:
http://msdn.microsoft.com/en-我们/library/system.web.dynamicdata.metamodel.aspx
Have you looked at how you register the data context in you Global.asax file?
This link may have more details that can help:
http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.metamodel.registercontext.aspx
and this:
http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.metamodel.aspx