Welcome to MSDN Blogs Sign in | Join | Help

Quick post on two new issue on the block related to Debugging/Breakpoint in Visual Studio 2008

  • After installing VS2008 SP1, single stepping through code does not work, misses break points and generally, it is unpredictable and unusable.  It will generally hit the first break point but after that it is totally unpredictable.

       Solution is to Apply KB HOTFIX 957912

  • You cannot get the breakpoints in external JS files to get hit when that code is called from a popup window (Specific to IE 8)

Workaround as mentioned by Greggm in his blog  :

IE 8 has a feature called Loosely-Coupled Internet Explorer (LCIE) which results in IE running across multiple processes.
Older versions of the Visual Studio Debugger get confused by this and cannot figure out how to attach to the correct process.  You can work around this by disabling the process growth feature of LCIE.  Here's how:

1. Open key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main
2. If it doesn't exist, add new DWORD named TabProcGrowth
3. Set TabProcGrowth value = 0

Following my previous post after uninstalling IE 8 from the my Dell Vista Laptop and restoring back to IE 7  was of no help.

IE 7 was also crashing as soon as I start typing URL in the address bar after opening where as Firefox crashes on opening.

Applied my PSS troubleshooting trick to capture crash dump for IE. Analyzing it shows IE crashed due to Stack overflow.

04badf30 100025d7 100025d7, calling 1000257f



04badf30 100025d7 100025d7, calling 1000257f
04badf5c 100025d7 100025d7, calling 1000257f
04badf88 100025d7 100025d7, calling 1000257f
04badfb4 100025d7 100025d7, calling 1000257f
04badfe0 758446d7 mswsock!SaBlob_Query+0x2d , calling 1000257f
04bae010 7584463c mswsock!Rnr_DoDnsLookup+0x129

Above stack does not tell anything more than address 1000257f (Module must have got unloaded).In this scenario next step is to check for all the third party modules loaded in the process which would be top suspects.

We’ve  GoogleToolbarNotifier, Google Desktop Search and Symantec Shared dll’s loaded in the process.

Started Un-installation process one bye one

1) Uninstall GoogleToolbarNotifier, IE 7 and Firefox still crashes.

2) Uninstall Google Desktop Search, IE 7 and Firefox works great.Tongue out

Checking Google Desktop Search dll’s version loaded into the process.

0:016> lmvm GoogleDesktopIE
start    end        module name
41000000 4101d000   GoogleDesktopIE   (deferred)            
    Image path: C:\Program Files\Google\Google Desktop Search\GoogleDesktopIE.dll
    Image name: GoogleDesktopIE.dll
    Timestamp:        Tue Jan 08 00:44:23 2008 (47827A0F)
    CheckSum:         0001C5FA
    ImageSize:        0001D000
    File version:     5.7.801.7324
    Product version:  5.7.801.7324
    File flags:       0 (Mask 3F)
    File OS:          0 Unknown Base
    File type:        0.0 Unknown
    File date:        00000000.00000000
    Translations:     0409.04b0
    CompanyName:      Google
    ProductName:      Google Desktop
    InternalName:     Google Desktop
    ProductVersion:   5.7.801.7324
    FileVersion:      5.7.801.7324
    FileDescription:  Google Desktop
    LegalCopyright:   Copyright (c) 2003-08 Google. All Rights Reserved

Google Desktop is bundled  on Dell Vista Home Addition.

Later on added updated version for Google Desktop Search(5.9.906.4286). IE and Firefox still working great.


On my home Vista laptop I got a weird problem with IE8 may be due to some malwares.Whenever I try to open IE 8 it prompts me ‘your last session closed unexpectedly ‘ blah blah .

image

Clicking on either of option provided.It crashes iexplore.exe

Fastest solution runs into my mind was to un-install IE 8 and install it again later. Quickly going to add/remove program . Run –> appwiz.cpl.

Upon thoroughly scanning installed program list I was not able to figure out IE 8 as the installed program on my Vista.

image

But checking View Installed Updates, I can see it listed there as Windows Internet Explorer 8.

Bu that was not the case in Windows XP where we can un-install everything from Add/Remove Program.In Vista, IE 8 is categorized as an update rather than program.

image

After un-installing IE 8 you must reboot for the changes to take effect and to get back happy IE 7.

Happy surfing.. Martini Glass

<Snip>

When there is more than 1 server in web farm scenario it is an obvious choice to go for session out-of-proc either with SQL server or State server. While storing session with SQLServer if you see issues with SQL deadlock during peak loads involving DeleteExpiredSessions . It goes like this…

Looking at the current implementation of the DeleteExpiredSessions stored procedure:

CREATE PROCEDURE DeleteExpiredSessions
AS 
  DECLARE @now DATETIME 
  SET @now = GETUTCDATE() 
  DELETE ASPState.dbo.ASPStateTempSessions 
  WHERE Expires < @now 
  RETURN 0

GO

This would take the locks on all the expired records for deletion and these locks may be promoted to page locks. This can give rise to deadlocks with other ‘session state write statements’ when the number of records marked for deletion increases. By default this stored procedure is supposed to run every minute.

For Example: In one of the case. Looking at no. of records which are marked for deletion

Select count (*) from ASPState.dbo.ASPStateTempSessions  WHERE Expires < getdate()

The number of record marked for expiry was 138,000 out of 146,000 records and the size of “ASPStateTempSessions” table was crossing ~20 GB!!

<Snip>

Read the complete post at webtopics

Till then bye bye…

Today using Logparser for parsing the ETL file.I did spend some time on filtering it right way to see the activity for specific time frame. Thought to share with you.

In ETW file we’ve TimeStamp column that contains value like "2009-07-31 13:34:42"

Now if you would like to filter all the records that should fall between 13:30 and 13:35 , you would have do it like this

logparser "select * from iis6.etl where to_time(timestamp) between timestamp('13:33:00', 'hh:mm:ss') and timestamp('13:35:00', 'hh:mm:ss')" -rtp:-1 -o:datagrid

Output:

clip_image002

TO_TIME() is used to convert a full TIMESTAMP value into a TIME-only "subtype", so that you can use the original timestamp in comparisons with a time value.

TO_DATE is the DATE equivalent of TO_TIME.

For example:

logparser "select * from iis6.etl where TO_DATE(timestamp) = timestamp('07/31', 'MM/dd')" -rtp:-1 -o:datagrid

Till the bye bye…

<Snip>

Procdump is a light weight Sysinternal's command-line utility whose primary purpose is monitoring an application for CPU spikes and generating crash dumps during such spikes which an administrator or developer can use to determine the cause or to share the dump with PSS for further analysis. It also can serve as a general process dump utility that you can embed in other scripts.

It completely eliminates the need to maintain different utilities like Debug Daig 1.1 for 32 bit processes and adplus for 64 bit processes on the same server.

The Problem

Looking at task manager we can see w3wp.exe process is spiking CPU between 49%-60% intermittently and then immediately it goes down.

In order to troubleshoot we need to capture 2 sets of dump for w3wp.exe when process reaches 50% CPU and stays there for 3 consecutive seconds or so.This, using Debug Diag 1.1 or Adplus could be a tricky task as it would require great deal of accuracy to manually generate dumps when the actual CPU spike happens or we may end up taking dumps without capturing real activity responsible for the spike.

The Savior

</Snip>

 

Read more at our team blog here

Quickly helping  one of colleague where after restoring applicationhost.config from the back up on win2k8 IIS 7 we started receiving 503 Service Unavailable on the browser.

As the very first step was to check event viewer where we had the following logged:

Log Name:      Application
Source:        Microsoft-Windows-IIS-W3SVC-WP
Date:          7/28/2009 12:46:10 AM
Event ID:      2280
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      <computer_name>
Description:
The Module DLL C:\Windows\System32\inetsrv\compdyn.dll failed to load.  The data is the error.

compdyn.dll ==> Dynamic Compression

Checking the inetsrv folder we were not able to locate this dll.That’s interesting.

Option provided was to :

1) Either to turn off the dynamic compression in applicationhost.config

  • appcmd.exe set config "Default Web Site" -section:system.webServer/urlCompression /doDynamicCompression:"False"

2) Or to install the dynamic compression modules from Add Role Services Wizard, select Dynamic Content Compression

Enlarge

Till then bye bye …


This week I wrote new blog post on our team blog webtopics which talks about above error and reason for it ..

Check it out here here : http://blogs.msdn.com/webtopics/archive/2009/07/27/uploading-a-file-using-fileupload-control-fails-in-ie8.aspx

Till then bye bye :)

While working with classic ASP on my Vista IIS 7 box.I encountered two different problems:

Firstly if you migrated your applications to IIS 7 or developing your new asp application and on browsing the asp page if you encountered error like 404.3

HTTP Error 404.3 - Not Found

Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.

Upon checking Handler Mappings you won’t find mapping for *.asp to asp.dll. In that case you need to get ASP component installed  from Windows feature –> IIS –> WWW services –> Application Development feature –> ASP

(By Default ASP is not the installed on IIS 7 :) )

image

Secondly, I was having pretty simple two asp page.In one page I was including second page as following:

<!--#include virtual="/taxi/temp1.asp" –> . Upon browsing it failed with error:

“An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.”

For sure shot my application wasn’t throwing this custom error. Then who was in that case :(.
As as security feature on IIS 7,sending script error details to client browser has been turned OFF. You can revert back to default behavior to check actual error by going into

Features views  -> ASP –> Debugging Properties –> Send Errors To Browsers : set it to True –> Apply

image

After applying above setting actual error spit on the browser and ready to debug it further :)

Active Server Pages error 'ASP 0126'
Include file not found
/Taxi/index1.asp, line 10
The include file '/taxi/temp1.asp' was not found.

Till then Bye Happy

This week I wrote new blog post on our team blog webtopics which talks about above error and reason for it ..

You can visit here : http://blogs.msdn.com/webtopics/archive/2009/06/19/intermittently-system-web-httpexceptions-a-field-or-property-with-the-name-columnname-was-not-found-on-the-selected-data-source-is-thrown-when-the-application-is-under-heavy-load.aspx 

 

Till then bye bye :)

Working today on my Vista when I Added New Virtual Directory from IIS manager pointing to newly created folder on Desktop and upon browsing it ended with 500.19 on browser

image

Next thing came in my mind was to compare permission on new folder on Desktop(even though error message does not indicate of that Tongue out)

 image

Aha there seem to be difference between the two folders. The new folder on Desktop was missing IIS_IUSRS and USERS Group– Read & Execute permissions.

The IIS_IUSRS group is intended to replace the IIS_WPG group. This built-in group has been granted access on all the necessary file(\wwwroot) more…

After adding IIS_IUSR account first and when I tried browsing it and the error message changed to 401.3 – Unauthorized due to ACL. This forced me to add USERS group to resolve this issue completely!!!

Till then bye Smile

PS: on Vista home edition you won’t be able to find Local Users & Group option in Computer management MMC. It has been this way since XP.

While setting up repro for one of the customer on my Vista IIS 7.I ran into couple of issue(i’ll post both) of my own.My application gave up with "Service Unavailable" "HTTP error 503"

No matter whatever I browse .htm , aspx everything ends up with that error 503.Looking into event viewer to see something reported apparently that was clean.

And this issue seem to be happening only with one particular app pool "MyTest".That forced me to try and create new app pool and see if that resolve the problem.

Bingo!!! everything works like charm in the new app pool "MyTest2" .

Obvious thing was to compare both the app pool setting in applicationhost.config

        <applicationPools>
         
<add name="MyTest" autoStart="false" />
            <add name="MyTest2" autoStart="true" />

Checking in IIS manager

image

Aha we’ve autoStart=”false” and notice stop icon against MyTest app pool. This feature is there in case app pool crashes for some reason and Rapid fail protection kicks in app pool should start automatically.

We can either change this option in applicationHost.cofig or Edit app pool properties in IIS manager as follow:

image 

It would have been nice if warning/error reported in Event viewer or some useful message on browser rather than 503.Wink

PS : In this case Failed Request (FREB) wouldn’t have helped as worker process was not initiating.

In 3 years at PSS I've worked on many issues related Dynamic Control i.e

1) Controls not able retain value on postback.

2) Controls getting disappeared on postback

3) Event handler not fired on first click works fine on second click

4) Viewstate issues blah blah...

 

No matter how complex the issue maybe I got it resolved by sticking to following silver bullet point

  • Always add the dynamic control in Page_PreInit()
  • Always assign ID when loading dynamically

For Example

protected void Page_PreInit(object sender, EventArgs e)
{
        Control c= LoadControl("./WebUserControl2.ascx");
        i=i+1;
        c.ID= i.ToString();
        PlaceHolder1.Controls.Add(c);
}


OR

protected void Page_PreInit(object sender, EventArgs e)
{
         LinkButton button1 = new LinkButton();
         button1.ID = "button1"
         button1.Text = "button1"
         PlaceHolder1.Controls.Add(button1);
}

 

This way it would make sure Dynamic Controls are added to Page Control tree and ID's are not messed up.

Tip: Best way to troubleshoot is to enable trace=true at page level and track that particular control id's or compare view source for first time page rendering with view source on page postback.

Hope it helps Winking

We can either use ADSI,WMI,JScript etc ... to query IIS 7 config like how many website, virtual directories.Lately we have another option to use Microsoft.Web.Administrator namespace either from Web app or from Powershell.

At the root level we've class called ServerManager which exposes all the functionality you will need for querying/editing IIS 7 config.

First thing is we need to add reference to web application in VS 2008 for  Microsoft.Web.Administrator.dll from c:\windows\system32\intesrv.

C#

Using Microsoft.Web.Administration;

public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
    {

ServerManager sm = new ServerManager();
foreach (Site site in sm.Sites)
       {
           Response.Write("Display IIS site: <br>");
           Response.Write(site.Id.ToString() + " - " + site.Name);
       }

Powershell
PS C:\ > $iis = new-object Microsoft.Web.Administration.ServerManager
PS C:\ > $iis.sites

Browsing it from VS 2008 cassini we are able to query successfully and list website id and its name.

Publish it under Default website which is running on Network Service in integrated mode and with Anonymous auth enabled. Now here we are expected to fail with Exception for permission denied.

Add Network Service Read & Execute permission on c:\windows\system32\inetsrv\config to bypass security exception.After this we can query IIS config for Non Admin user.

Or other option would be:

1) Use <identity impersonate=true> with specific username and password who has rights to read
2) Run the app pool in the identity of user who has access to read config.

For Powershell it is not possible to query config's unless you're admin.

Till Then Smile

Today while working on vista IIS 7 and I was trying to delete  one of module named as CustomErrorModule for Default Web Site and immediate I was notified with this nice error.  

image

And this seem to be happening only with Modules which are listed as Native . I was able to delete Managed module without any problem.Nothing was reported under system & application event viewer  logs.

Solution was to go at Root level Modules configurations and select the required native module and Unlock it.

image

In IIS 7 Native Modules seem to be locked by default and same would be valid incase of appcmd tool.

C:\Windows\System32\inetsrv>appcmd unlock config /section:httpErrors
Unlocked section "system.webServer/httpErrors" at configuration path "MACHINE/WEBROOT/APPHOST".

See Ya!!!

More Posts Next page »
 
Page view tracker