的Visual Studio 2012 MVC 3多不想要的线程 [英] Visual Studio 2012 MVC 3 multiple unwanted threads

查看:217
本文介绍了的Visual Studio 2012 MVC 3多不想要的线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我创建并一直使用在Visual Studio 2012年我也使用实体框架的一个MVC 3 C#项目。调试时,我得到了著名的过程或自最后一步线程已经改变了。消息上调试图标。一段时间以来,它并没有改变程序的行为,所以我忽略了它。

I have an MVC 3 C# project that I created and have been using in Visual Studio 2012. I am also using the entity framework. When debugging, I get the known "The process or thread has changed since last step." message on the debugging icon. For some time, it didn't change the behavior of the program so I ignored it.

然而,最近我有同样的信息和行为(与调试器跳回到执行的方法,在我的断点的开头),只是现在实际上得到执行两次我的code。我的意思是,现在任何数据库插入正在运行至少两次。这可能是有益的,我也用实体框架知道,我的刀片都被导入一个存储过程,做了简单的插入完成。

Recently, however, I have had the same message and behavior (with the debugger jumping back to the beginning of the executed method where my breakpoint is) except that now my code is actually getting executed twice. What I mean is that now any database inserts are being run at least twice. It may be helpful to know I am also using the entity framework, and my inserts are all being done by importing a stored procedure that does a simple insert.

无处在我的code我明确地旋转起来新主题或尝试做任何多线程。我不是很熟悉多线程,但是当我调试,使用线程窗口,我看到7线程,以及两个辅助线程一个主线程。 (对不起,我会张贴图片,但我是一个新的用户,他们不会让我)。

Nowhere in my code do I explicitly spin up new threads or attempt to do any multi-threading. I am not very familiar with multi-threading, but when I debug and use the threads window, I see one main thread with 7 threads, and two Worker Threads. (Sorry I would post an image but I'm a new user and they won't let me).

然后,当我按F5继续,我的单断点再次袭来,我看到一个主线程,线程3和6!工作线程。

Then, when I hit F5 to continue, my single breakpoint is hit again, I see one main thread, 3 threads, and 6!! Worker Threads.

我在哪里可以看看,看看那里/为什么有被纺多个线程?此外,有什么事情我都做,因为最后一步的信息获取进程改变了吗?我已经无解研究这个数周。

Where can I look to see where / why there are multiple threads being spun up? Also, what could I have done to get the process changed since last step message? I have researched this for weeks with no solution.

感谢您预先的任何帮助!

Thank you in advance for any help!

推荐答案

所以我想通了什么问题了。事物的问题被保存到数据库中两次是页面的两倍在有不显眼的阿贾克斯(曾经在我的布局页,和一个单独的页面上)的结果。

So I figured out what the problem was. The issue of things being saved to the database twice was a result of having unobtrusive ajax on the page twice (once in my layout page, and one on the individual pages).

看多线程的问题似乎的东西与浏览器,因为我没有做任何形式的线程在我的应用程序。虽然小图标,并在方法退一步是烦人(,我想在某个时候解决它的),它实际上并没有改变应用程序的行为。

The issue of seeing multiple threads seems to be something with browsers since I am not doing any threading of any kind in my application. Although the little icon and stepping back in the method is annoying (and I'd like to resolve it at some point), it does not actually alter the behavior of the application.

这篇关于的Visual Studio 2012 MVC 3多不想要的线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆