CodeAttest

Martin Kulov's Blog

VSTS, Oslo, INETA, ASP.NET, Debugging .NET Applications, Tips and Tricks

August 07, 2008

Operation Aborted Error in IE7

Yesterday I bumped into a strange Operation Aborted error. I really did not where to start looking for this error. I tried running the web site with first chance exceptions [1][2][3] turned on, running a script debugger and HTML validator but without any luck. Seems that the error is IE app related and you have to debug the IE process itself in order to find it. I did not want to go into that muddy waters so I run a more deeper search in google and I found the reason.

One of our third party components was generating HTML on the fly while the DOM is still being created. In short the problem is that scripts that are not direct child of BODY cannot modify the BODY element while the DOM is still being created.

You can find detailed explanation on the great Infinities Loop blog and in BUG: Error message when you visit a Web page or interact with a Web application in Internet Explorer: "Operation aborted" (KB 927917).

One possible solution is to put a setTimeout call for about 0.5s which calls your script at the time when (hopefully) DOM will be ready. I would not recommend this approach in general though.

For some reason the script which was marked with DEFER attribute, obviously was not deferred until the page is loaded. The problem was detected while running IE7.

[1] First and second chance exception handling (KB 105675)

[2] How to Stop on First Chance Exceptions - Visual Studio .NET 2003

[3] Demystifying first-chance exceptions (Part 1)

Labels: ,


# posted by Martin Kulov @ 3:34 AM |




Missing Performance Counters

One of the servers I support was missing its performance counters. I wanted to run perfmon to see how the server is performing and instead of text names of all performance counter, I saw only numbers listed under Performance Object list.

A quick look in google gave a solution to this problem. All you have to do is to run this command in %windir%\system32:

lodctr /R

You can read more about it in How to manually rebuild Performance Counter Library values (KB 300956).

It worked for me on Win2003 64bit Intel machine.

Labels: ,


# posted by Martin Kulov @ 2:59 AM |




February 08, 2008

Get latest does not work in TFS

Get Latest Version may not work properly in some circumstances with TFS 2008. I recently found how to reproduce this strange problem that I was experiencing from some time. It happens that if you have already set up a working project on your machine (after you have resolved possible problems with Web Application Projects in the initial project setup), the project may fail to update when you ask to Get Latest Version even using Get Specific Version option is on. The reason for that may be a newly added project to your solution. When someone adds a new project to your solution VS2008 automatically creates a new mapping for this project. So if your workspace mapping before the update is like $\MyProject - > c:\projects\MyProject, when you as for the get latest version you will find that VS has created additional mapping for the new project like $\MyProject\NewProject -> c:\projects\MyProject\NewProject. After that point, for reasons that I am not aware of, get latest version does not work any more. To solve this problem you have to open the Source Control panel from Team Explorer and in the workspace dialog box to edit workspace mappings and delete this new entry.

If you do not edit workspace mappings you will most probably get this error:

---------------------------
Microsoft Visual Studio
---------------------------
Source Control Explorer

All files are up to date.

No files were updated because the requested file versions were previously downloaded.

To force an update, use the "Get Specific Version" command with the "Overwrite all..." option checked.
---------------------------
OK  
---------------------------

Labels: ,


# posted by Martin Kulov @ 4:55 AM |




January 25, 2008

Precompiled sites and VirtualPathProvider

Coskun Sunali posted an amazing article how you can set up VirtualPathProviders to run when using Precompiled sites.

Do you know that even MS do not use VPP in precompiled sites? Check this out.

This is just an example what you can achieve with Reflector and a lot of patience.

(The support for VPP is explicitly disabled in precompiled sites by Microsoft. We do not know the reasons why they did it, so please you this fix with careful testing :).)

Good work Josh!

Labels: ,


# posted by Martin Kulov @ 3:27 AM |




January 23, 2008

.NET Source Code Debugging Tips

John Robbins is the ultimate debugging hero for me.

Read to what John Robbins says about the new released .NET Framework Source Code:

  1. If you've been downloading your symbols with the Microsoft Symbol Server, make sure to delete your cache directory before you start downloading from the new symbol location.
  2. Shawn says you'll want to check the "Search the above locations only when symbols are loaded manually" in the Options dialog, Debugging, Symbols node. Personally, I think it's much better to leave that unchecked so that you get the symbols and source downloaded automatically. Yes, there will be some slowdowns on the download, but by getting the symbols and source every time you access the item, you'll fill up the cache quicker.
  3. If you're having some trouble getting everything to work, turn on the source server diagnostic messages in the Options dialog, Debugging, General node:


Also, as you are loading downloading source files by double clicking on them in the call stack window, you can see the path reference location in the status bar.

  1. To get both the new Reference Symbol Server and Microsoft Symbol Server set in your _NT_SYMBOL_PATH environment variable to the following:
    UPDATE: This is the correct syntax
    SRV*c:\symbols*http://referencesource.microsoft.com/symbols;
    SRV*c:\symbols*http://msdl.microsoft.com/download/symbols
  2. For you advanced hackers out there, I tried like crazy to get SYMCHK and PDBSTR to work for pre-downloading and bulk source extraction working, but with no luck at all. It appears that the WinDBG tools don't have support for source servers that use http downloads, but the QFE added that support to Visual Studio 2008. (See my article if you don't know what I'm talking about.)

Read original post.

Labels: , ,


# posted by Martin Kulov @ 1:48 AM |




January 22, 2008

COMException loading solution

Happy New Year to all of you! I hope that my blog will keep helping you solve problems that are really tough to find.

Recently I bumped into a very strange problem when I tried to open a fresh new solution from the source control and then I got a strange error -  Microsoft Visual Studio - System.Runtime.InteropServices.COMException:

System.Runtime.InteropServices.COMException

I wonder what the Cancel button will do here, but that is a different story.

A quick look at Solution Explorer, showed that all projects were loaded successfully except one - a Web Application Project.

I put some time to dig in with WinDbg and then I got some tips on what is going on.

In order to load the Web Application Project you must make sure that the URL that the project is using, is valid and can be resolved. This can happen pretty often since when you download a project from source control for the first time, it is highly unlikely that you will have the web site already set up.

And important note that I have to make also is that if you are running Vista, you should run in elevated privileges as well.

Using Web Application Projects is not really my choice for web site development. I would rather choose the new Web Site model. I hope that I will have the time to go further into this topic here.

The problem is reported to Microsoft and will be fixed in VS2008 SP1 (no date has been announced yet).

Labels: , ,


# posted by Martin Kulov @ 12:22 AM |




November 19, 2007

Code 12 Driver Problem

Never install third party drivers from Windows Update. I lost about one day trying to get one virtual machine working again. It turned out that during the last updates I installed a new driver for my video card. This unfortunately resulted in conflict with the network adapter driver and leaving the machine without any connectivity. As Shenan Stanley, another Microsoft MVP, states in TechArena Community post:
“It has been explained before - many times - on these newsgroups by many different people that relying on the Windows Updates for hardware drivers should *not* be done. The hardware drivers that appear there have to be submitted to Microsoft by the hardware vendors anyway. They have to pay for the priviledge to have them placed there. There is also a process through which the drivers to be placed there have to go through to get the 'logo'/'certified'. That all takes time. By the time it is done - usually several releases from the manufacturer have passed by - sometimes solving issues with that original driver, sometimes just new features, sometimes nothing major.”

In my case I had to completely uninstall ATI PCI Express (3GIO) Filter Driver to get the machine running fine. If you have similar problems, open Device Manager and look for devices with yellow exclamation mark. When you open properties of the failed device and click Resources you will see this error:
Code 12: This device cannot find enough free resources that it can use.
On my machine I got the error for two devices: VM Additions S3 Trio32/64 and Intel 21140-Based PCI Fast Ethernet Adapter (Emulated).

Steps to uninstall the driver:

Vindows Vista
1. Go to Device Manager (To access device manager, Go to START/CONTROL PANEL/SYSTEM & MAINTENANCE/SYSTEM/DEVICE MANAGER
2. Expand "SYSTEM DEVICES"
3. Find "ATI PCI EXPRESS (3GIO) FILTER DRIVER" and delete it.
4. Reboot
5. Check and make sure "ATI PCI EXPRESS (3GIO) FILTER" has been deleted. If it has not, restart at step 3
6. If it has been deleted, Reboot 1 or 2 more times and then your computer should be OK.


Make sure that you check Delete the driver software for this device when you uninstall it, otherwise Vista will install it again when you restart.

Good luck!

PS: This is my 200th blog post <edited>and third year of blogging</edited>. Of course, I never imagined that I could write for such a long time. Please let me know what would you like to see more, what you do not like and any other feedback you may have. Thanks for reading!

Labels:


# posted by Martin Kulov @ 3:35 AM |




August 08, 2007

Fiddler and IE problem under VPN

I just found why Fiddler2 works from time to time on my (not so) new Vista installation. It happened that the problem occurred because of my VPN connection.
Almost 99% of the time I am out of the office I am using VPN connection, because my Communication machine (another story) is located at the office. It never occurred to me that the problem in Fiddler was because of the active VPN connection. And I always blamed IE7.
Well, the problem is still IE7, but today I found the exact reason. It is actually stated in Fiddler documentation. It is first mention at Common problems and then resolution is described at Configuring clients.
The problem lies somewhere in IE. When you have active VPN connection IE takes proxy settings from that VPN connection no matter if you have “Use default gateway on remote network” option turned on or off. In my case it was off. You have to open Settings dialog of your active VPN connection and set proxy value there and Fiddler will work again.


Labels:


# posted by Martin Kulov @ 12:12 AM |




April 30, 2007

Vista Migration Problems

Yesterday I finally moved to Vista.
I had a lot of problems on the way and before you even start thinking about it, look at these issues part of the known issue list for running Visual Studio 2005 with elevated privileges on Vista.
But before you do that have a look at this! On a completely new installation of Vista you will find out that your Remote Desktop connections are running very slow. This is how you can fix the problem. Too bad that you have to lose a neat feature of Vista.
Remote Desktop slow problem solved


Visual Studio 2005 on Windows Vista Issue List
Running with elevated administrator permissions


...

Title: Just-In-Time (JIT) Debugging of an elevated process will fail
Description: Elevated processes cannot be JIT Debugged by VS 2005. This includes system processes, such as IIS, and applications started by selecting ‘Run as administrator’.
Workaround: The debugger must be attached manually before the debugger will catch unhandled exceptions or user break points (System.Diagnostics.Debugger.Break, __debugbreak, etc).


Title: Dataset Designer extremely slow on Windows Vista
Description: The Dataset Designer appears extremely slow on Windows Vista. This is due to a change in the way Windows Vista supports Windows painting and renders the designer mostly unusable.
Workaround: None


Title: Debugging Web applications on IIS may fail without the IIS 6 Compatibility Layer installed
Description: ASP.NET Debugging against a Web application running on IIS 7 may fail without informing the developer as to why.
Workaround: Developers should install the IIS 6 Compatibility Layer for IIS 7.


Title: Opening a web solution with many sites is much slower on Windows Vista
Description: Users with web solutions that refer to many sites (typically 20 or more) will see a large decrease in performance when opening the solution. The solution will open but it may take some time.
Workaround: None

...

Labels:


# posted by Martin Kulov @ 12:20 AM |




February 17, 2007

Service Unavailable problem

In the Academy's .NET classes, we usually create a separate application pool and run the web site under account that has access to MS SQL database. There are a few caveats to get it all running and I am so used to them that it takes a few seconds for me to resolve that kind problems.
Today I had a problem that was new to me.
After creating the new pool, adding the user to the IIS_WPG group and accessing a page for the first time I got the error “Service Unavailable”. Typically the reason that you will get this error message is when you forget to add the application pool user to IIS_WPG group as described in KB 823552. You may also get this error message when you have incorrectly entered the account password in the Identity tab of Application pool properties, or when the account is disabled or require password change.
There is another catch if you use a blank password for the account as described in this post in MSDN Forums.

Since none of these resolved my problem, I opened the Event Viewer and saw event log warnings like the one below:

A process serving application pool 'SQLAppPool' terminated unexpectedly. The process id was '4048'. The process exit code was '0xffffffff'.

Surprisingly this warning was repeated few times before the pool is actually disabled. Usually when there is a problem with the account identity, you will only get this error once. So I tried to watch out for access denied messages in the indispensable Sysinternals File Monitor and for Failure Audit event log messages, but they did not show anything.
It turns out that Keith Brown also blogged about this Service Unavailable problem more than a year before but I did not find resolution there.

So I decided to check out the permissions in IIS metabase using the Metabase Explorer tool in IIS 6.0 Resource Kit. IIS Metabase is the configuration store of IIS and you should not touch anything there unless you are pretty sure what you are doing. A lot of IIS configuration options that are not shown in the IIS Manager UI, are stored in the metabase and most important – the permissions that each account has to an option. I compared current permissions on my web server with the default ACL list as described in KB 326902. It turns out that IIS_WPG group was not resolved properly as a security object so I reapplied the security permissions for IIS_WPG and run iisreset.exe to restart the IIS.

Volla! The web site was up and running again.

Labels:


# posted by Martin Kulov @ 12:22 PM |




February 06, 2007

Developer Toolbar Download

Have you heard of Internet Explorer Developer Toolbar? This is an add-in for IE 6.0 and above that allows you to track, enable and disable different elements and features of the current loaded page in IE. For example you can disable all CSS for the page and see how it looks like without it. Or you can outline all table and table cell and show image dimensions or hide all the images. This tool is amazing. I only reason that I did not use it before is because it is still Beta 3 and you know how much I hate browser add-ins.
Still it seems quite stable for now, so I am going to keep it, if it continues to be dutiful add-in.
Here is list of features:

• Explore and modify the document object model (DOM) of a Web page.
• Locate and select specific elements on a Web page through a variety of techniques.
• Selectively disable Internet Explorer settings.
• View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
• Outline tables, table cells, images, or selected tags.
• Validate HTML, CSS, WAI, and RSS Web feed links.
• Display image dimensions, file sizes, path information, and alternate (ALT) text.
• Immediately resize the browser window to a new resolution.
• Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
• Choose direct links to W3C specification references, the Internet Explorer team weblog (blog), and other resources.
• Display a fully featured design ruler to help accurately align and measure objects on your pages.
• Find the style rules used to set specific style values on an element.
• View the formatted and syntax colored source of HTML and CSS.

The Developer Toolbar can be pinned to the Internet Explorer browser window or floated separately.

This Beta 3 version of the toolbar contains functionality and stability enhancements over previous versions, including:
• Style Tracer: Right mouse click on a style value for an element and select Style Tracer to find the style rule that is effecting that value.
• CSS Selector Matches: View a report of all style rules set and how many times they are used on the current page.
• View Source: View the formatted and syntax colored source of the original page, currently rendered page, element or element with the styles that are effecting it.
Your feedback is greatly appreciated. Please visit the Developer Toolbar Wiki on Channel 9 to enter bug reports, comments, and suggestions.

Supported Operating Systems: Windows 2000; Windows Server 2003; Windows Vista; Windows XP
Internet Explorer Developer Toolbar requires Internet Explorer 6.0 or later.

Labels:


# posted by Martin Kulov @ 11:50 PM |




January 21, 2007

Windows Time error

My laptop was overheating for a few weeks so I decided to open it and clean it up.
Few lessons that I learned:
You can access almost all parts just by opening the bottom panels, detaching the panel that holds the keyboard and removing the keyboard. There is no need to unscrew all bolts just to clean the processor fan.
The processor fan can get pretty choked. In my case, about 80% of the fan vent was jammed and no air could pass at all. There is no way to see that until you open the laptop.
Write where every bolt place is. Now I have one spare one :)
My sound does not work too, so I have to open it again to see what I forgot to plug in (I did forget the plug the keyboard in first place :)).
Surprisingly, the laptop booted normally at the first time, but because of the unplugged battery my clock was not synchronized. I got the idea the Windows Time service will help me to synchronize the time automatically. I started the service, opened Date and Time dialog, Internet Time and clicked on Update Now button. After few seconds waiting I got the error “An error occurred getting the status of the last synchronization. The RPC server is unavailable.”. I tried restarting the service, unregistering and registering again but with no success. After 15 minutes of trying different options, I decided to manually set the time. Just for the experiment, I thought to check the update process once more, after I already set the correct time. Volla! The update process worked as supposed. It seems to me that the time synchronization does not work when there is huge difference in time. In my case the default time set to the computer was 01/01/2003. I think that’s why Microsoft named this service “Windows Time”. It is supposed to update time only, and it does not update date :))).

Labels:


# posted by Martin Kulov @ 1:42 PM |




January 20, 2007

Internet Explorer speed up

I found how to improve in times the loading speed of my Internet Explorer. You know that during years of exploitation Windows and especially Internet Explorer gets clumsier and clumsier day by day. I reached the time now when I have to wait IE to load for about 5 to 15 seconds!!! This is really irritating for me. Few times I even forgot what I was going to start in IE.
I found by chance that there is a way to manage the ActiveX and Browser Helper Objects (BHO) in Internet Explorer 6.0. You can enable and disable them using the Add-ons manager located in Tools/Options/Programs/Manage Add-ons. In my IE there were 47 Add-ons! Imagine this – 47 DLLs are loaded in every single IExplore.exe process. Now I know the reason why my IE could not load more than 20-25 instances in one user session.
In the moment I instantly disabled all of them leaving only Fiddler, XML DOM Document 3.0, Google and Google Toolbar add-ons.
My add-ons list have many ActiveX objects for playing audio and video. There are two items for Windows Media Player, three - for Google, many - for Microsoft Office and different kinds of ActiveXs for various third party apps. And please note that I am not a fan of IE plugins and usually I am careful in preventing installation of such plugins. Image what this list will look like if I start to install every cool plugin that I found for IE.
After disabling almost most of the add-ons, my IE now loads for about 1sec. I have the feeling the Google Toolbar is a very badly written plugin, because disabling it makes my IE load for about 0.5 sec. Or it is just the way IE works when it has to create additional toolbar.
Nevertheless I think Microsoft should find a way to speed up loading of these plugins and isolate and provide better way for managing, versioning and isolating them.
This is a real life example how one good work done by Internet Explorer team, gets insulted by almost every Windows user on this world, just because of poorly written plugins.
Keep in mind that disabling add-ons can make some site inoperational for you. If this happens, you should enable the corresponding object again and restart IE.

UPDATE: I accidentally deleted the post. Now it is back, but the previous comments are lost :(. I will post them below.

Post by Angelarii
Great job. Apparently works for IE7 too, improved my startup time to less than a second!

Post by Stefan Dobrev
Google toolbar is not the safest add on you can install :) Look here http://www.google-watch.org/toolbar.html I'd prefer not to install it on my PCs.

Post by Martin Kulov
Well, I am not a big fan of Google toolbar either. The only think that I can not remove it, is because this is the only way to see Google's PageRank. I do not know any other way to easily display it on every page visit.

Labels:


# posted by Martin Kulov @ 4:09 PM |




January 11, 2007

Fiddler and ASP.NET Development Server

Happy New Year my dear readers,
Thank you for reading my humble blog and I wish you all the best in 2007.

My promise for the next year is to keep you updated on almost all developer events that are happening in Bulgaria. There are a lot of places where you can find information about worldwide events, product releases and gossips so I will most probably not discuss them. Unless of course I have something really interesting to say.
I will keep posting problem solving techniques and various tips for diagnosing and resolving every day programming issues.
And I will continue pressing you to get involved in the up growing Bulgarian software development community.
There are many ways you can be involved.
Look for upcoming events of Bulgarian Association for Software Developers site, Sofia.NET User Group and IASA Bulgaria. Come to the next meeting that we organize and say that you what to be a member and what to help the community. We will be happy to have you. Do not miss the opportunities that are lying in front of you.

As part of my promise, I will now give you a great tip that I found by accident today.
If you know me in person, you will probably know that Fiddler is one of my favorite tools. And you will most probably know that I do not like the ASP.NET Development Server and usually teach all our students in the Academy how to setup and use IIS in their web projects. Today I found out that is extremely hard to use Fiddler and ASP.NET Development Server if you do not how.
The problem is that the ASP.NET Development Server accepts requests only when the address is using localhost or 127.0.0.1 and Fiddler can intercepts requests only when they are not using localhost or 127.0.0.1 but instead use the machine name for the request. This put us in really awkward situation until we find Hannes Preishuber’s post on how to configure Fiddler so that it changes every request automatically from machine name to localhost. However we still need to access the URL using server’s machine name. If you are a careful reader you will notice this awesome comment on his post which says that when you use “localhost.” (keep in mind the trailing dot) and the request will pass through Fiddler and then will go directly to ASP.NET Development Server. No change in Fiddler script is necessary. Beautiful!

Congratulations to all Bulgarians for joining the EU.
Let’s wish luck and courage to our innocent medics sentenced to death in Libya.

Labels:


# posted by Martin Kulov @ 3:23 AM |




March 12, 2005

"sp_" prefix for stored procedures is evil

Here is the reason why you should NOT name your stored procedures with "sp_" prefix. I was on my way to use this prefix in my last project but one good fellow saved me :) The article contains sample code also (which by unfortunate I have not tried). Through Scooter's Musings post.


Update: MS SQL 2005 also has this problem.

Labels:


# posted by Martin Kulov @ 12:29 AM |




This page is powered by Blogger. Isn't yours?

 




Calendar Martin Kulov's Calendar   RSS Aggregate this blog

DevReach - The Premier Conference for Microsoft Technologies for SEE

Mobility Day 2008 Conference

DevReach - The Premier Conference for Microsoft Technologies in Bulgaria

International Association of Software Architects

SofiaDev .NET User Group

Microsoft Most Valuable Professional

View Martin Kulov's profile on LinkedIn

MSDN Event Bloggers




Recent posts




History




 
Copyright © 2004-2008 CodeAttest Ltd. All Rights Reserved.