Question

I've figured out the fix to my problem, my question is 'why'.

I have a .net4 WCF service that uses Entity Framework and LINQ to connect to a SQL Server 2012 database. I had one section of code that inserted data into a table and it violated a foreign key constraint, when that happened, it crashed my web service' w3wp.exe process.

I fixed the issue and it's working fine. My question is... really? That's what crashed my web service? My understanding is that exceptions coming from SQL are well handled in Entity Framework and if that is what is really crashing my web server, it makes me feel uneasy about the stability of .net.

My assumption is that I'm doing something wrong but I'm having a hard time figuring out what I'm doing wrong. Anyone else have issues similar? Thanks!!!

Was it helpful?

Solution

Well as it turns out it was me (as suspected). In my code I have numerous try/catches and in the catch clause I have the following

#if DEBUG
   System.Diagnostics.Debugger.Break();
#endif

I accidently deployed a version of my code that had the DEBUG switch turned on so it was hitting that code whenever any error occurred and fired up the JIT debugger on the server. Duh. Silly me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top