c# - Visual Studio development server unexpectedly executes Thread.Abort -


the following code results in our visual studio 2012 development web server, or alternative iisexpress, killing appdomain of our webapp executing thread.abort in of it's constituent threads threadpool. not understand why? cannot find documented states under circumstances web server this. also, there precious little "verbose" output of web server itself.

this took several days worth of effort track down. normal debugging techniques proved worthless. had resort tried , tested method of commenting out method bodies until reached "ah-ha" moment.

one of our developers had inadvertently created temporary file , closed again deep within 1 of our asp.net services.

filestream fs = file.create(strfilepath); | fs.close; 

the strfilepath accidentally set same location webapp's assembly location. namely:

var basepathuri = new uri(assembly.getexecutingassembly().codebase); var strfilepath = path.getdirectoryname(uri.unescapedatastring(basepathuri.absolutepath)); 

it's worth saying, error corrected correctly writing system temporary file space.

so once, again, know bad practice, why visual studio web server behave does?

ps know there deployment difference between development web server , production web server (e.g. apache or nginx) regard copying content temporary asp.net location. in fact, problem not manifest in deployment.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -