VS2010 repeatedly crashing

Sep 4, 2013 at 9:43 PM
Edited Sep 4, 2013 at 9:46 PM
In VS2010 ultimate on Win 7 64 bit with PTVS 2.0 I am getting an error message along the lines of 'VS encountered an error, this may be caused by an extension...' etc. every few lines of code that I type. Also VS is crashing completely with '...looking for a solution to this problem...' dialog and then restarting, losing any entered code quite often. In one instance of VS I have open now it happens as soon as I type anything after the default 'hello world' line.

Should I report these as bugs or is PTVS not meant to run on VS2010? I have encountered a lot of problems in the short time I have been trying out PTVS. When is PTVS expected to be out of beta?
Coordinator
Sep 4, 2013 at 10:08 PM
Can you do Start->Run->eventvwr and go to Windows Logs->Application. There you should see an Error entry with sources of "Application Error" and ".NET Runtime" If you can copy the details from there and post them here we might know what's going on.

PTVS is definitely meant to support 2010, if you want a more stable version you can try PTVS 1.5 which is stable. You'll need to first uninstall PTVS 2.0 Beta. You might also want to make sure you have the latest updates for VS 2010 installed.

We'll be releasing the RC for 2.0 soon and RTM will come after that, probably roughly around the time when VS 2013 is released.
Sep 4, 2013 at 11:05 PM
There are two errors:

First error:

Error 04/09/2013 22:56:23 Visual Studio 2010 Remote Debugger 1002 None
Log Name: Application
Source: Visual Studio 2010 Remote Debugger
Date: 04/09/2013 22:56:23
Event ID: 1002
Task Category: None
Level: Error
Keywords: Classic
User: WIN7-I5DESKTOP\Guy
Computer: Win7-i5Desktop
Description:
The description for Event ID 1002 from source Visual Studio 2010 Remote Debugger cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:



The remote debugger is unable to communicate with Visual Studio, and must abort the remote debugging session. Please restart debugging.

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Visual Studio 2010 Remote Debugger" />
<EventID Qualifiers="49152">1002</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-09-04T21:56:23.000000000Z" />
<EventRecordID>168543</EventRecordID>
<Channel>Application</Channel>
<Computer>Win7-i5Desktop</Computer>
<Security UserID="S-1-5-21-1308154294-1817979074-246837814-1000" />
</System>
<EventData>
<Data>The remote debugger is unable to communicate with Visual Studio, and must abort the remote debugging session. Please restart debugging.</Data>
</EventData>

</Event>

Second error event:

Log Name: Application
Source: .NET Runtime
Date: 04/09/2013 22:55:56
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: Win7-i5Desktop
Description:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AggregateException
Stack:
at System.Threading.Tasks.TaskExceptionHolder.Finalize()

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1026</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2013-09-04T21:55:56.000000000Z" />
<EventRecordID>168541</EventRecordID>
<Channel>Application</Channel>
<Computer>Win7-i5Desktop</Computer>
<Security />
</System>
<EventData>
<Data>Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AggregateException
Stack:
at System.Threading.Tasks.TaskExceptionHolder.Finalize()
</Data>
</EventData>

</Event>

Does remote debuggging on a Linux machine work in 1.5 ?
Coordinator
Sep 4, 2013 at 11:48 PM
remote debugging across to Linux is new in 2.0, so it won't be available in 1.5. Is attempting to attach to the remote process what's consistently causing the crash for you? Have you been able to do any remote debugging so far, or is it consistently crashing?
Coordinator
Sep 4, 2013 at 11:59 PM
This particular exception (AggregateException thrown from TaskExceptionHolder.Finalize), unfortunately, is very hard to narrow down from the logs alone because it happens on the finalizer thread when GC runs, so the original context is entirely absent. We did have a number of bugs in 2.0 beta that exhibited this problem which will be fixed in the upcoming RC release (or you can just try to grab the most recent sources and build them to see if it helps you).

There is also a workaround of sorts to make this problem less prominent. One of the things that changed about TPL Tasks in .NET 4.5 compared to 4.0 was the way unobserved task exceptions were handled, as described here: http://blogs.msdn.com/b/pfxteam/archive/2011/09/28/task-exception-handling-in-net-4-5.aspx. This still indicates a problem, generally speaking, but the change means that it no longer brings down the entire process. Since .NET 4.5 is an in-place upgrade for 4.0, once you install it, VS 2010 will be using it as well to run itself, and this will prevent the crashes, though you may still see regressed functionality due to underlying cause.
Sep 5, 2013 at 8:27 AM
dinov: No I am not remote debugging. I have been able to get remote debugging working successfully on an existing application and there was no crashing. I did notice that after I imported ptvsd there seem to be no intellisense working around it.

I can induce the 'remote debugger' error above like this:

Open a VS2010 - New Project - Python application - OK
Under the 'hello world' line type a new line: x = raw_input('press enter to continue')
Click run button - app runs - I get an hour glass over the console window, then 1 second later VS crashes.

I'm wondering if it is to do with running a project that has not been saved before first run. If I do save it before first run, when I run the program I get a 'Save File As' dialog with the default directory of Temporary Projects. I do the save and the program runs by just flashing the console window on the screen, I can't see if it has any text on it, it's too quick, but it doesn't wait for keyboard input as it should. VS doesn't crash under these circumstances but, obviously, the two line python program is not functional.

There is no remote debugging going on.