68727

Visual Studio 2012 MVC 3 multiple unwanted threads

Question:

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.

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.

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).

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!

Answer1:

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

The issue of seeing multiple threads seems to be <strong>something with browsers</strong> 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 (<em>and I'd like to resolve it at some point</em>), it does not actually alter the behavior of the application.

Recommend

  • Cocos2d Jump Animation & Moving
  • Cutting down bag to pass to udf
  • Load page directly to anchor tag
  • How do I implement a picture instead of my red rectangle?
  • Default route for all extreme situations
  • Set Visual Studio (conditional) breakpoint on local variable value
  • sql for calculating points for games
  • Insert multiple values into hidden field
  • lldb error: use of undeclared identifier
  • How to remove fragment from fragment manager when activity is restored after being destroyed
  • Google cloud datastore emulator init data
  • Updating and removing unique join relationships in CakePHP
  • Thread synchronization with syncwarp
  • Tools for understanding HTML layout
  • Where these are stored?
  • How can I run DataNucleus Bytecode Enhancer from SBT?
  • Jquery Knockout: ko.computed() vs classic function?
  • CSS bleed-through with cfinput type=“datefield”
  • how do i write assembly code from c#?
  • Mysql - How to search for 26 records that each begins with the letter of the alphabet?
  • preg_replace Double Spaces to tab (\\t) at the beginning of a line
  • formatting the colorbar ticklabels with SymLogNorm normalization in matplotlib
  • Debugging ASP.NET on a built-in web server suddenly stops
  • How to extract text from Word files using C#?
  • How to check if every primary key value is being referenced as foreign key in another table
  • Sending data from AppleScript to FileMaker records
  • Perl system calls when running as another user using sudo
  • Trying to switch camera back to front but getting exception
  • ActionScript 2 vs ActionScript 3 performance
  • SVN: Merging two branches together
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • Acquiring multiple attributes from .xml file in c#
  • Free memory of cv::Mat loaded using FileStorage API
  • Angular 2 constructor injection vs direct access
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • Programmatically clearing map cache
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • java string with new operator and a literal