App Pool Crashing – Part 1

While working on a website that’s designed to run 24 hours a day with no user interaction (an automatically-updating display for users to walk past and see), I came across an interesting phenomenon.

Now, the website is designed in ASP.Net 3.5 with AJAX. There’s an UpdatePanel and a Timer, and that’s it for the AJAX portion. The Timer control fires every 10 seconds and fires the UpdatePanel. Simple enough, right? Well, at random instances the website would stop updating and throw a ScriptResource.axd related error, but only visible in the status bar at the bottom of the browser. After some exhaustive research on this error and finding very little documented on the Internet, I received some feedback from some colleagues that it might be an app pool recycling problem in IIS.

So, my next step was to modify the IIS settings on that server. I removed everything and only enabled recycling once a day. I also turned on app pool logging in the Event Log as described in this article. The next day everything was still working, so far so good! However, the following day (2nd day) the website stopped updating again. This time I checked the Event Log and found the following warning:

I looked up the error code 8007006d and it came back to “App Pool Crashed”. Well, I think that was fairly obvious. Now to figure out why the thing crashed, when all it’s doing is updating a lousy panel every 10 seconds!

So, at this time I enabled healthMonitoring in the app’s web.config file to attempt to capture more events when the app pool crashes again. This, combined with the IIS log and extended app pool logging in Event Viewer, I hopefully will glean something valuable about this event. Stay tuned for Part 2, which should hopefully be the root cause and solution to this issue.

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

WPF Databinding to a Combobox

So I’m trying to hone my skills in ASP.Net while at the same time learn new technology and languages. I’ve been working with WPF since it came out, and the more I play with it the more I like it. My most recent project includes quite a bit of databinding, which I quickly learned is very different from ASP.Net.

For this posting, I’ll assume we need to databind to a Combobox. Before I begin, please note this is of course not the only way to do this. There are numerous ways to accomplish the same result, and someone probably has a better way of doing it. This just outlines one method that works, while providing type safety.

Ok, with that out of the way, first create a public class that handles a key and a value. This is to prepare for your type safe list that the Combobox requires as its datasource. It can look as simple as this:

public class myObject
{
public int objKey {get; set;}
public string objValue {get; set;}
}

Ok, we have a class for our type safe List. Now, go get your data and put it somewhere. In my project, I read from a SQL table, put the information into a DataSet, then iterated through the DataSet adding each row to the List like so:

foreach(DataRow r in ds.Tables[0].Rows)
{
int key = Convert.ToInt32(r[0].ToString());
string value = r[1].ToString();
newObject.Add(new MakesObject {objKey = key, objValue = value });
}

Where the type safe list is named newObject. Ok, this will fill your type safe list with each object from the DataSet. Now you can bind the Combobox to the List the same way we did it in ASP.Net, only the naming changed slightly. Instead of DataSource, it’s called ItemsSource. The DataTextField and DataValueField properties are now DisplayMemberPath and SelectedValuePath. So to bind to the Combobox you can do this:

cmbMakes.ItemsSource = newObject;
cmbMakes.DisplayMemberPath = “objValue”;
cmbMakes.SelectedValuePath = “objKey”;

That’s it. You will now have your Combobox filled with your data, and the key from your database query is set to the value of each item.

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Problems installing SQL 2008

I had originally installed SQL 2005 Express on my laptop, and something happened during the installation and it got corrupted. I was unable to uninstall, whether I used Add/Remove programs, ran setup.exe ACTION=uninstall from the command line while in the SQL root path, even if I used msicuu2 and msizap to look for the GUIDs associated with SQL 2005. Nothing worked. I thought installing SQL 2008 Express might “fix” or overwrite something and then get me the latest version to play with anyway. Couldn’t have been further from correct. Now I had two corrupt installations and no way to remove either one.

After much research online and trial and error, I was at a point of giving up and wiping the hard disk. I HATE wiping the hard disk for something like this, I feel like I failed somehow. Outside of serious corruption there’s always a way to fix something software related, right? Well, I stumbled upon an MSDN posting later today where users were having similar issues, and one person suggested removing the following registry entry:

HKLMSOFTWAREMicrosoftMicrosoft SQL Server90

So, I went back into Add/Remove Programs, removed all things SQL, stopped all SQL services and set them all to Disabled, restarted the computer, made sure visual Studio 2008 had SP1 installed (because once before it barked at me saying that was required) and tried the install again. Voila! Everything installed perfectly except Full Text Search. Since I’ve been without a local database on my development machine for the past two years, Full Text Search is the least of my problems right now! I’m just thankful I finally have something to work with.

So, if anyone is having problems with the Express SQL versions, or something similar is happening that is preventing you from upgrading to either SQL 2008 Express or SQL 2008 Enterprise or Standard, check out this MSDN thread and see if it helps you:

http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/5fc58507-9f40-4213-acbd-32a57c8822d7/

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Setting a Silverlight slider control at initialization

I recently ran into a problem where I needed a Silverlight slider control pre-populated with a specific value when the page loaded, but if you use the slider`s ValueChanged event in the code behind file, it dies. Why? Because as the page loads and initializes, the code behind is trying to run and the slider control hasn`t finished being created yet. Putting the values I wanted them to start at worked fine, as long as you put them after the Initialize(); call in Page_Load, but I still wanted the ValueChanged method to fire when the value changed on the slider. Here`s what I did to make sure the ValueChanged method fires and I can still pre-populate the slider at initialization:

Slider slider = (Slider)this.FindName(“slidername”);
if (slider == null)
return;
else
{
// Do something
}

The first line there looks to make sure the control was created before even continuing. If it exists, it then will allow whatever you want from it without throwing an error.

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Error creating a new SSIS project in BIDS 2005

I recently encountered an issue where I hadn’t created an SSIS package in a while, and when I opened BIDS 2005 and said “Create New Project”, after naming the project and proceeding it barked at me, saying “Failed to save package file with error 0x080040155 ‘Interface not registered’. Turns out somehow my MSXML assembly files got unregistered. The way to fix this that worked for me, was to re-register msxml3.dll, msxml4.dll and msxml6.dll. Some said to just do 3 and 6, which would probably work, but it doesn’t hurt to register all three anyway. That did the trick!

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube