How To Best Debug The Creation Of Unwanted Threads In Web Application

Dec 7, 2010

After an IISRESET on my public facing webserver, the initialization of my app seems correct. That is, in the Application_Start event I launch a new "email" thread whose purpose is to sleep until the configured time, upon "waking" produce a report and email it to my administrative user(s) and go back to sleep until the configured duration elapses at which time, the report is created again and emailed out. I am currently configured to start at 1900 and produce a new report every 12 hours.

As time marches on with this production site, however, something is causing an "extra" thread to be created. This, in turn, results in a duplicate report being emailed. While the problem is benign enough, I'd like to clean this up if possible. Here's a snippet:

[code]....

The above code seems to work fine (like I stated, after an IISRESET, I see the one logged event from the Application_Start event followed by the log entry from my "email" thread: "EmailThread will sleep for nnn minutes...etc.". But somehow (over time) I am getting another instance of the EmailThread thus producing 2 reports instead of just one at the scheduled "wake time".

In the IIS application pool assigned to this website, I have the following settings:

- Recycle worker processes (in minutes) is UNCHECKED
- Recycle worker process (number of requests) is UNCHECKED
- Recycle worker process (at various times) is UNCHECKED / nothing specified
- [Idle timeout] Shutdown worker process after being idle for (time in minutes) is UNCHECKED

I have noticed that the Application_Start event can be entered again (in one case roughly 38 minutes after the first time) which causes my code to run again and create another [and unwanted] thread.

View 2 Replies


Similar Messages:

AJAX :: Unable To Debug / Debug EditPanel.debug.js File Of HTML Editor?

Apr 13, 2010

I want to debug EditPanel.debug.js file of HTML Editor, but it never shows in VS 08 and Im sure it executes to that line.What I did to enable debuggingUnchecked both 2 checkboxes for disabling the debugging

Set ScriptMode="Debug"

Change following line

[ClientScriptResource("AjaxControlToolkit.HTMLEditor.EditPanel", "AjaxControlToolkit.HTMLEditor.EditPanel.js")]
to
[ClientScriptResource("AjaxControlToolkit.HTMLEditor.EditPanel", "AjaxControlToolkit.HTMLEditor.EditPanel.debug.js")]

View 3 Replies

Factory Method Pattern Clarification - Allow The Client To Delegates The Product Creation (Instance Creation) To The Subclass

Mar 29, 2010

My understanding of Factory Method Pattern is (Correct me if i am wrong) Factory Method Pattern "Factory Method allow the client to delegates the product creation (Instance Creation) to the subclass". There are two situation in which we can go for creating Factory Method pattern.

(i) When the client is restricted to the product (Instance) creation.

(ii) There are multiple products available.But a decision to be made which product instance need to be returned. If you want to create Abstract Method pattern

You need to have abstract product Concrete Product Factory Method to return the appropriate product.

public enum ORMChoice
{
L2SQL,
EFM,
LS,
Sonic
}
//Abstract Product
public interface IProduct
{
void ProductTaken();
}
//Concrete Product
public class LinqtoSql : IProduct
{
public void ProductTaken()
{
Console.WriteLine("OR Mapping Taken:LinqtoSql");
}
}
//concrete product
public class Subsonic : IProduct
{
public void ProductTaken()
{
Console.WriteLine("OR Mapping Taken:Subsonic");
}
}
//concrete product
public class EntityFramework : IProduct
{
public void ProductTaken()
{
Console.WriteLine("OR Mapping Taken:EntityFramework");
}
}
//concrete product
public class LightSpeed : IProduct
{
public void ProductTaken()
{
Console.WriteLine("OR Mapping Taken :LightSpeed");
}
}
public class Creator
{
//Factory Method
public IProduct ReturnORTool(ORMChoice choice)
{
switch (choice)
{
case ORMChoice.EFM:return new EntityFramework();
break;
case ORMChoice.L2SQL:return new LinqtoSql();
break;
case ORMChoice.LS:return new LightSpeed();
break;
case ORMChoice.Sonic:return new Subsonic();
break;
default: return null;
}
}
}
**Client**
Button_Click()
{
Creator c = new Creator();
IProduct p = c.ReturnORTool(ORMChoice.L2SQL);
p.ProductTaken();
}

Is my understanding of Factory Method is correct?

View 3 Replies

How To Debug Web Application

Dec 6, 2010

In Many Interview they have asked me that.

How would u debug web application in .net?

I Say the using F10, F11 but this is not the correct answer.

View 3 Replies

Debug Application - Relatively Slow

Apr 23, 2010

why is it that when i debug my application in chrome it is relatively slow between postbacks compared to internet explorer? when i use internet explorer, its lightning fast.

View 6 Replies

How To Debug A Silverlight Application

Mar 10, 2011

I am currently developing a silverlight application, however yesterday I started getting the following error message every time I run the project:

If I click "yes" to debug - nothing happens. Also, I have no Line 1805 in any of my source files!

This error message started appearing yesterday, and appears as soon as I run the project, shortly before the first page loads. If i click yes or no, the project then loads and runs perfectly, I cannot see any unwanted behaviour.

I have been using source control, so I rolled back the project to a point before the error started appearing, however I am still getting the error!

Could it be a setting in VS Web Developer Express 2010 that I have accidentally changed?

View 2 Replies

C# - How To Debug An Application That Is Time-dependent

Nov 3, 2010

I'm working on an application (a web application, asp.net and c#) which is datetime-dependent, so, based on the current date, it will launch forms for the logged user to fill in.

I've been thinking about how we're going to simulate real usage of the application, for debugging and testing purposes.

So I'm talking about replacing all those:

DateTime currentDate = DateTime.Now;

with something like:

DateTime currentDate = MyDateClass.GetCurrentDate();

And then I'll have a class:

public class MyDateClass
{
private DateTime _currentDate;
public DateTime GetCurrentDate()
{
// get the date, which may be different from DateTime.Now
return _currentDate;
}
public void SetCurrentDate(DateTime newCurrentDate)
{
// set the date to the value chosen by the user
_currentDate = newCurrentDate;
}
}

allowing me to set the current data, by invoking the SetCurrentDate method, for example, in the code-behind of a link button and a calendar input.

how should I exactly store the DateTime variable, throughout all the application? I can't work with the session in this class, right? Should I work with the Thread?

[code]....

View 2 Replies

Configuration :: How To Debug The Application After Deployment

Mar 10, 2010

I want to know what are the ways to debug the application after deployment. Let's say I have used x-copy deployment, to copy dll and also some source code files. If I want to modify some source code and recopy them into production. Can somebody tell me how to debug those modified files?

View 2 Replies

Mobiles :: How To Debug Web Application In Emulator

Feb 3, 2010

how we can debugg a page from mobile emulator in web application.

View 1 Replies

Cannot See The Break Point When Debug An Application

Jan 21, 2010

I've defined a route in Application_Start, as so many tutorials have instructed

RouteTable.Routes.Add(
"Files",
new Route("Files/Art",
new FileRouteHandler()));

And created my own RouteHandler. However this doesn't seem to work at all.When I debug the application, I can see (via a break point) that the route gets added, however when I browse to "http://localhost/MyApplication/Files/Art" I get a browser 404 (not an ASP.net 404).

View 2 Replies

Application Works In Debug Mode But Not When Deployed To IIS?

Jan 26, 2011

I have an asp.net application which works fine in debug mode but gives a error when i access the default.aspx
after deploying to IIS.

View 4 Replies

Visual Studio Unable To Debug Application

Jan 7, 2011

I am developping an MVC3 RC2 application and just after hitting F5 on my asp web application, I am getting this error message program '[7780] w3wp.exe: Managed (v4.0.30319)' has exited with code -2 (0xfffffffe).So I am totally unable to debug my application

View 10 Replies

Debugging - Can't Switch Web Application Into DEBUG Mode

Jan 14, 2011

I have an ASP.NET 3.5 web application. For the application:

Configuration set to "DEBUG;
"Define DEBUG constant" checkbox is checked for "DEBUG" configuration;

web.config file contains 'true' as value for 'debug' attribute of 'compilation' node.

Nevertheless to everything the following code:

[code]....

put "DebugMode: False" into result string. In the same time I can't connect to the application with VisualStudio in debug mode...

Question:

how can I get real value of debugging mode?

View 2 Replies

Is It Possible To Debug A Web Application That's Not Started From Within Visual Studio

Aug 13, 2010

The default ASP.NET web server that launches from within Visual Studio (Casini) is a little buggy on my development machine, so I like to publish to a local IIS instance on my dev machine and look at the web application there. However, I'm not automatically in "Debug Mode" when I launch the application this way.

I know that VS 2010 has an "Attach to Process" debug feature, but I'm not sure exactly how to use it. What do I need to do to be able to debug a local IIS ASP.NET web application from within Visual Studio? Specifically:

What settings do I need to change in the configuration of my web application?

What "Package/Publish Settings" do I need to change?

Is there anything I need to change in IIS?

Is there anything special I need to do in the "Attach to Process" screen?

Background Information: I'm running Visual Studio 2010 on Windows XP SP3 with IIS 5.1 and .NET 4.0.

Additional Information:

I should add that I've tried attaching to aspnet_wp.exe, but when I go to a page that I know has a breakpoint in it, I get the following message when I hover over the "open circle" breakpoint:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

View 5 Replies

Configuration :: C# Web Application Works In Debug But Not When Deployed To IIS?

Oct 27, 2010

I know there have been countless posts on these types of problems, and I have read through alot of them as well as doing Google searches, but I have not found anything that applies to my specific situation. If anyone has posted a similar question link me to the post with any appropriate derisive comments . Mods if this is the wrong forum feel free to move the post to the appropriate location.

I am a newbie C# developer. I have been getting my feet wet writing a C# web app for my department. I am using the following system:

Windows 7 Professional Visual Web Developer 2010 Version 10.0.30319.1 .Net framework 4.0.30319. IIS version 7.5.7600.16385 Internet Explorer 8.0.7600.16385CO SQL Server 2008 R2

When I run my application in the VWD debugger everything works fine and looks the way I want it to work. When I deploy to IIS (which is on the same box that I develop on) I start having some issues. Here is a breakdown of the problems I am having:

I have an asp:menu control with orientation set to horizontal. When I initially load the sitre after a deploy the menu displays correctly. But when I go to a different web page in the app the menu switches to vertical and the width of each menu item spans the width of the div that surrounds it. On the same page that causes issues with the asp:menu I also have asp:ComboBox controls that are used to filter information on the page. The combo boxes just look like text boxes. The data that should populate the boxes is not present.

I also have some ajax accordion controls contained in asp:updatepanels, neither of which work. The accordion controls are all expanded, and I cannot collapse them. If I trigger an update the entire page reloads instead of just the specific control.

I do not receive any errors when I browse to the page that causes the problems. It loads just fine everything is just jacked up. Like I said, everything works flawlessly in the VWD debugger. I know the VWD debugger does not use IIS, which makes me think this is an IIS issue, but I do not even know where to start to pinpoint the problem.

View 3 Replies

How To Know Whether Application Is In Release Or Debug Mode Using Vb.net Code

Apr 30, 2010

My requirement is to check whether my application is in debug mode or release mode in DLL class.

View 6 Replies

Trying To Debug A Page On A Web Application Used Internally On An Intranet?

Dec 22, 2010

I am having great issues trying to debug a page on a web application used internally on an intranet. When entering the page the "Security Information" Pop Up Box appears. The whole application is running under https.

To try and debug the issue, I have used Fiddler, and looked at the urls for every component, javascript, css, images, and user control components. Everything I have seen from Fiddler shows that the urls start with required https! So, I am completely confused why this message should be shown - it appears everything the page is posted back.

View 2 Replies

AJAX :: How To Debug WebMethod In Form Application

May 3, 2012

I have gone though  article [URL] ....

Sending and receiving json data.

There i have noticed you are debuging webmethod to get the properties of city object.

In my application i am making a ajax call to a webmethod and getting a error,  in firebug it shows internal server error . I believe there must be some bug in my webmethod. But i dont know how to debug it setting break point in my code didn't work as it overlooks the break point.

View 1 Replies

Visual Studio :: Get A Debug Running Remote Web Application

Jul 10, 2010

Debugging running remote web application

View 1 Replies

C# - How To Correctly Debug Web Application On Local IIS 7.5 With VS 2010 Beta2

Feb 20, 2010

I'm sort of new to developing Asp.net webapplication projects while running them on a local IIS. Till now I used the 'Use Visual Studio Development Server' option.

I'm using Visual Studio 2010 Beta 2.

Edit: less complex sample code

Following code sample:

List<string> _list = new List<string>();
_list.Add("asd");
_list.Add("asd2");
_list.Add("asd3");

Now I want to debug / step through some line of codes with _list. While using 'Use Visual Studio Development Server' I can see the contents of _list in the quick watch. If I select 'Use Local IIS Web server' and debug through the same piece of code, the quickwatch tries to display me the same values by showing me a spinning wheel for about 10 seconds with a resulting 'Function evalutation disabeld because a previous function evalution timed out. You must continue execution to reenable function evalution' message.

Afterwards I get a windows error dialog with 'Unhandeld win32 exception occured in w3wp.exe [844] The Just-In Time debugger was launched without necessary security permission..'

I do run Visual Studio 2010 Beta 2 as Administrator. I start debugging by pressing F5. It seems that I can't really debug this way. Do I somehow have to attach the VS debuggerto the IIS process? If yes, how to do so?

What am I doing wrong, and how to solve it?

And by the way, is that erroneous behaviour new in VS 2010? I've never expierencied that in VS 2008.

View 2 Replies

Debug Behavior In Application Start, Global.asax?

Jan 13, 2010

Not using Cassini, but IIS7 to run an ASP.NET app.

The debug behavior is flakey. Sometimes it works, sometimes it doesn't. I was able to step into the application start event in global.asax but sometimes I can't.

Sometimes VS2008 opens the published global.asax so I have two instances of global.asax opened in VS, the source and the published.

I reset the AppDomain and IIS and I can't put my finger on why this is happening.

To add, while it won't go into application start, I have an OnChangeEventHandler event - it does step into the event handler.

View 1 Replies

Httpmodule - Debug HTTP Module Init Event From Application?

Sep 21, 2010

Is it possible to debug the init event from a http module? If I set breakpoints, they don't get triggered.

View 2 Replies

C# - Is Workflow Right For Dynamic Workflow Creation In Web Based Application

Jun 22, 2010

I am new to workflow and just know some of its features. I want to do a project in WF. It will be a web based intranet application where user will be able to define workflow dynamically through web interface.Duration for completing a task can be many days.With these requirments I am not sure will use of WF helpful in quick development or it will increase work ?Please advice me should I try to learn WF for this project or should do it with C# and asp.net

View 1 Replies

Visual Studio :: System.TypeInitializationException When Executing A 4.0 Web Application In Debug Mode?

Feb 11, 2011

[code].....

There are plenty other similar static methods defined within the class.

When does it fail: ONLY when the solution is compiled in 'DEBUG' mode. Everything works fine in 'RELEASE' mode.

What have I already tried:

1. Including a static constructor inside 'Utility' class - FAILED

2. Marking 'Utility' class with 'static' keyword: FAILED

3. Changing platform target from 'Any CPU' to 'x64': FAILED

As highlighted above, the issue is really not with VerifyPassword() method per se. Rather it is with the instantiation of 'Utility' type. That's why an exception is thrown from the constructor. Since 'VerifyPassword' is it is the first static method called, it appears in the stack. Just for the sake of proving that, I removed the call to VerifyPassword and returned 'true' instead. That way I was able to login to the application (no password verification), but failed at a later stage where I had called the Utility class on another method, namely Utility.ValidateSKUAdjustment(txtCurentMonthM1.Text).

View 1 Replies

Production System - Use Visual Studio (2008 With SP1) To Debug The Remote Application ?

Apr 3, 2010

First time i am going to work on (maintenance project) application that is already in production.The application was developed in ASP.net 3.5/C# 3.0(web forms) with jQuery,Ajax,Sql server 2005 and microsoft enterprise library 4.0.,WCF services. Questions (bear with me if my question is wrong)

1) Is it possible to use Visual Studio (2008 with SP1) to debug the remote application (i.e already in production)?.What are the tools do i need to use in order to keep track the things in case something went wrong?

2) Simply looking into Log file ,will solve the issues?

3) After having done with enhancements,is it possible to directly deploy the DLLs into production server.Won't it affect the running application?

what are the procedures i need to follow.Client is ready to provide any tools for my support.(What are the area do i need to aware to handle production system

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved