.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Application hangs (100% cpu) outside debugger, but when debugging it runs ok.

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :.NET Framework
Be prepared, this is a tricky one. One of my customers he is building a proof of concept using my software components. When running outside the debugger, the application will hang, using 100% CPU in the main thread. At this point attaching the debugger is unsuccessful. When running inside the debugger, the application runs fine. (.NET framework 3.5, Windows 7 Ultimate x86, running in VirtualBox (virtual environment)). Using Process Explorer I've tried to find some hints as to what's going on. Showing a callstack in PE at some arbitrary point when the app hangs is shown at the bottom of this post. The one line that caught my eye was this: halacpi.dll!HalClearSoftwareInterrupt+0x355 I googled around a bit, looks like a number of people ran into this, but nobody had found the true cause of/solution to this problem. One that came close was mentioning a patch for .NET framework 1.1, but there seems no information on later framework versions: http://support.microsoft.com/kb/904705 Some more details from my customer seem to point in the direction of GraphicsPath, which is used quite intensively and I know this class does a fair bit of switching to native land and back (PInvoke, also mentioned in the patch above). We really need to get this one solved, so let me know what to do to get some developer support on this one. Thanks, - Wout ntkrnlpa.exe!KeSetEvent+0x2a1 ntkrnlpa.e

View Complete Post

More Related Resource Links

CLR Debugging: Improve Your Understanding of .NET Internals by Building a Debugger for Managed Code


With the release of .NET, the Microsoft scripting strategy has evolved. Script engines can now compile or interpret code for the Microsoft common language runtime (CLR) instead of integrating debugging capabilities directly into apps through Active Scripting. With that change comes a new set of published services for including debugging functionality in a custom host application. You'll see how to use the debugging services published in the .NET Framework to create a full-featured CLR debugger that allows you to set breakpoints, view call stacks, browse variables, view processes, enumerate threads, and perform other important debugging tasks.

Mike Pellegrino

MSDN Magazine November 2002

Tip #107 Did you know . How to improve debugging performance for MVC2 application in Visual Studio 2

VS2010 Ultimate included IntelliTrace functionality by default.  IntelliTrace captures events (e.g. exceptions), and can affect performance of debugging. The typical performance hit is about 5% in the default mode (collection can be increased to...(read more)

Strange lockup in multithreaded application - Visual Studio debugger unable to break execution

Multithreaded C# application, Visual Studio 2008, Windows XP, Framework 3.5 SP1. This application is a little crawling utility to download pages from our website, extract some information and upload it into a database. It runs for a while, then somewhere between about 10 minutes and an hour in, it locks up totally, user interface and all. When I try to "break all" in the VS debugger, I get a message "cannot break execution". Now the confusing thing about this is that since the UI was locking up, I thought that some deadlock must be happening on the main UI thread. So I started stripping out any code and locks that were being acquired on that thread that might cause problems ... until there was nothing left. Even with the window simply spawning a bunch of worker threads on create, then totally forgetting about them and giving no reverse access, the lockup still happens, the UI still freezes and VS still can't break the execution.   There are 10 threads to do the crawling, and one each to do the processing and the uploading. The next thing I did was take out the uploading entirely to remove the possiblity of a deadlock in the SqlClient libraries. No difference. So now, the only things that could be really deadlocking the main thread that I can see are the centrally created HTTPWebRequest objects I'm using. WebRequest.create is supposedly thread safe

Debugging a Windows Service (VS 2008 / .NET 3.5) Using Debugger.Launch()

Hi, Everybody! I wrote a Windows Service using VS 2008 (.NET 3.5).  I wish to debug it.  I am able to build it and install it successfully.  When I start the service, the Visual Studio Just-In-Time Debugger (VS JIT Debugger) appears displaying the following message: An unhandled exception ("Launch for user") occurred in <WindowsService> [3392] (or [2560] or [5180] or ...).  I select the following Possible Debuggers <WindowsService> - Microsoft Visual Studio: Visual Studio 2008 and click the Yes button.  This is followed immediately by the following dialog box: Caption: Microsoft Visual Studio, Message: There is no source code available for the current location.  Clicking the Show Disassembly button results in displaying the disassembly.  The call stack shows mscorlib.dll!System.Diagnostics.Debugger.Launch() + 0x6a bytes.  The exception apparently occurs in Debugger.Launch();.  If I choose to continue, I am able to debug the Windows Service, stopping at the specified break points.  Why does the VS JIT Debugger appear in the first place?  How can I use Debugger.Launch(); without the VS JIT Debugger appearing?  See code below... protected override void OnStart(string[] args) { try { Debugger.Launch(); var t = new Thread(Start); t.IsBackground = true

Oulook.exe hangs when Domain User launches application through Interop windows 2003 sp2

Hello,I have a problem using Interop.Outlook on a win2k3 sp2 server. For windows 2003 version prior to sp1 i could use a specific identity for application pool and i had no problems launching outlook.User was authenticated and delegated correclty. With sp2 the Outlook.exe process is launched by the domain user specified as identity (also visible on Task Manager Processes) but no exception or time out is ever thrown.  The only way that i can make this to work is when i set impersonate=true in web config (without setting userName and password as this would have exactly the same affect with the application pool identity).Are there any permissions that i can set to overcome this?Help would be greatly appreciated. Normal 0 false false false EL X-NONE X-NONE Appreciate

general error login failed for user '' on windows 2008 in application that runs correctly on windo



we have a web application that one company prepared for us. this application read connection string from registery key in hkey_local_machine and connect to sql server 2005 database.

It worked correctly in windows server 2003. we changed our Server'OS to windows server 2008. but we have a problem to login. after try to login we see this error :

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Server Error in '/dabir' Application.

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be

Application Hangs with the default font "Segoe UI"

Hello All,

I got a problem after installing VS2010, i have already reinstalled VS2010 but the problem persist and now it occurs on VS2008 too.

In my application (WPF and .NET 3.5 SP1) when i open one of the application screens. The application hangs and stopped to work. I discovered that this is because of a GroupBox that have in text Header a Fontsize=16, if i let the fontsize default the problem dont occurs, i use default font "Segoe UI".

I did some testing and discovered that if I simply create a new application in WPF and .NET 3.5 and add a button on the screen and increase the font size of button to size of 14, 16 or 18, when I give F5 the application will hang. In design mode its works, but when i run the application its presents the problem.

The font dont have any problem because i can use it normally on "Notepad" or "Word" and when i create a new application in WPF and .NET 4 its works perfectly, it just give problems in .NET 3.5. Anyway i already reinstalled the Segoe UI font too.

If i change the font to Segoe UI Symbol or any other and change the size to 14, 16, 18 its works normally, just with the default font Segoe UI and font

Mouse scrolling works while debugging through IDE, but not when running my application separately...

I have an application with a WindowsFormsHost that is hosting a COM component.  When I run my application through the IDE, my mouse scroll events are handled correctly and the control scrolls as it should.  However, when I run the application by itself, my mouse scroll events don't do anything.  I've tried both Debug and Release builds and they both act the same way....as long as I'm running the app through the IDE, Debug or Release, my mouse scrolls act as they should.  Has anybody run into this type of issue? 

Debugging web application in ASP.NET is not possible anymore



I am using VS2005. My problem is I am not able to debug my web application any more.

I read few posts and tried various things but the problem still persists.

Any idea?


SQL/CLR Debugging hangs on Visual Studio 2003 and SQL 2005


I am unable to debug code from a SQL Database Project using the CLR.  After VS 2005 does the auto-attaching to the SQL server, VS hangs until I tell it to stop debugging.  Many others have reported this as a similar problem, however this only seems to affect me when I'm connecting to specific servers.  Specifically it seems to be remote connections.  When I attempt to connect to my SQL 2005 Developer Edition "locally" I get right through and can debug.

From my VS output window:


Auto-attach to process '[1688] [SQL] gx620-eric' on machine 'gx620-eric' succeeded.

Debugging script from project script file.



No rows affected.

(0 row(s) returned)

Finished running sp_executesql.

The thread 'gx620-eric [59]' (0x1730) has exited with code 0 (0x0).

The thread 'gx620-eric [59]' (0x1730) has exited with code 0 (0x0).

The thread 'gx620-eric [59]' (0x1730) has exited with code 0 (0x0).

The thread 'gx620-eric [59]' (0x1730) has exited with code 0 (0x0).

The program '[1688] [SQL] gx620-eric: gx620-eric' has exited with code 0 (0x0).


When I attempt to connect to a remote server running Enterprise Edition, it hangs after a successful attach. 


Debugging SQL CLR hangs with SQL Server 2005 and VS 2005




I am having a problem with SQL Server (Express) hanging during simple debugging of CLR code. I created a test project with a user defined function, and call this from the test script. The output log shows that the sqlservr.exe was auto-attached successfully, and then the everything hangs. I have to terminate debugging in order to regain control, and this takes perhaps a minute or two.


Any ideas?


Debugging Dotnet application


Hi All

I am trying to debug my asp.net appliction but cant do it

In my web.config file ihave already set the "debug =  true" even then it is not debugging.

Pls help. 

How to solve Application error at the time of starting debugger

Hello all,

This is my first post here. So if I posted in wrong forum point me to the correct direction.

I have installed Visual Studio 2005 (.Net 2.0) in my Windows Xp Service Pack 2 operating system.
When the setup had finished the wizard displayed me the following message :-

Visual Studio Setup is complete.
Setup is completed with some warnings."

Now when I clicked the "View Error Log" link a web document opened and there I found so many lines. Of them one is :-

"Failed to copy the file properly Webdev.Webserver.Exe"

Now when I'm trying to launch Vs2005 IDE, it is working but when I'm trying to run my programs by pressing F5 or anyone of the available debugger options I'm fetching the following errors :-

In case of windows applications (regradless whether the selected language is VB or C#) :-
"The application failed to initiliaze properly (0xc000007b). Click on OK to terminate the application."

In case of web a

Debugger Engine API: Writing a Debugging Tools for Windows Extension, Part 2: Output


Continuing to work on his Debugger Engine extension, Andrew Richards shows you how to avoid all the dangerous traps you might find as you enhance the tool's output.

Andrew Richards

MSDN Magazine May 2011

Debugging Asp.net application using XML Serialization

Debugging on Test or Production server is very difficult task for developers.First of all developers do not have any rights to touch the Test or Production environment and he received the list of bugs mainly due to data problem on production or Test Server.When developers try to reproduce the bugs on development environment is not possible because data in development environment is according to the developer mind set.

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

Integrating a Legacy Web Application in SharePoint

This month we will continue with the theme of deploying Microsoft's SharePoint as a company intranet by describing a method for integrating a legacy Web application inside a SharePoint site.

In many companies the intranet site is not just a home page with announcements. It houses Web applications used by many different departments. In last month's article, I built a page to search the employee table in Northwind (the sample database included in Microsoft's SQL Server). This month, I will move the Web pages used to add/remove records from the table into the SharePoint intranet.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend