ASP.NET MVC 添加视图对话框关闭

发布于 2024-11-04 03:11:46 字数 342 浏览 0 评论 0原文

最近,我从事的一个大型项目开始出现“添加视图”对话框的问题。单击“添加强类型视图”复选框时,微调器第一次出现大约一两秒,然后整个对话框关闭并消失。如果我打开该对话框并再次单击该按钮,它就会再次快速关闭。

该项目使用的是 ASP.NET MVC 2,我已经安装了 VS2010 SP1,无论是否安装了 MVC3 工具更新,都会出现此问题。它只发生在这个项目中,我已经在两台不同的开发机器上复制了这个问题。如果我创建一个新的 MVC2 或 MVC3 项目,这种情况根本不会发生,我拥有的任何其他中小型项目也不会发生。

我可以创建一个常规视图并将其更改为我自己的强类型,因此有一个解决方法,但这仍然很烦人。有什么想法可能导致此问题或如何解决它?

Recently a large project I work on started having a problem with the Add View dialog. When clicking the Add Strongly-typed View checkbox, the spinner comes up the first time for about a second or two, and then the entire dialog just closes and disappears. If I open the dialog and click the button again, it just closes again quickly.

The project is using ASP.NET MVC 2, I have installed VS2010 SP1 and this problem occurs with or without the MVC3 tools update installed. It only happens with this project, and I have replicated the problem on 2 different development machines. If I create a new MVC2 or MVC3 project, this does not happen at all, nor do any other small to medium sized projects I have.

I can of create a regular view and change it to strongly typed by myself, so there is a workaround, but this is still pretty annoying. Any ideas what could be causing this or how to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

对岸观火 2024-11-11 03:11:46

你使用版本控制吗?确保项目依赖的所有程序集(即由项目本身或其引用的程序集引用)都是同步的。在从 SVN 更新一堆项目并重建一些项目后,我刚刚遇到了这个问题(“添加视图”和“添加控制器”问题)。在我重建了我的 MVC 项目依赖的几个库后,这个问题得到了解决。

Do you use version control? Make sure all the assemblies that your project depends on (i.e. referenced by the project itself or by its referenced assemblies) are in sync. I've just run into this (both "Add View" and "Add Controller" problems) after updating a bunch of projects from SVN and rebuilding some. The issue was fixed after I rebuilt several libraries that my MVC project depends on.

何必那么矫情 2024-11-11 03:11:46

我遇到了同样的问题,并且无法按照此处所述打开“添加->控制器”对话框: 最近工具更新失败并出现依赖错误后添加控制器。就我而言,我已将模型添加到我的域中,但我忘记为这些新模型添加上下文;比如

public DbSet<Region> Regions { get; set; }

我在编译时没有错误,并且我在解决方案中没有使用这些模型,所以在运行时也没有错误。我想问题可能出在任何地方。

I had the same problem, and I could not open the Add->Controller dialog either as described here: Add Controller after recent tools update fails with dependency error. In my case, I had added models to my domain, but I had forgotten to add contexts for these new models; things like

public DbSet<Region> Regions { get; set; }

I had no error at compile time, and I was not using these models yes in the solution, so there was no error at run time either. I guess the problem can be anywhere though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文