Martin Kulov's Blog

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

March 12, 2010

Data and diagnostics cannot be collected

I am setting up Microsoft Test Manager in order to playback recorded manual tests for Propeople. I created a test case and set up my environment to collect data from web server.

However when I tried to start recording of my manual test with Microsoft Test Manager, I’ve got the error below:

Data and diagnostics cannot be collected

An error occurred while initializing diagnostic data adapters.

Timed out while initializing data and diagnostics adapters.

To increase the timeout values for all diagnostic data adapters, see the following link: http://go.microsoft.com/fwlink/?LinkId=169311.

I started poking around in Event Viewer in my local machine, test controller and test agent machines and I found some errors log at the Test Controller machine (pasting full error details so next poor soul can find it).

(QTController.exe, PID 4660, Thread 26) ControllerExecution: Exception: System.Net.Sockets.SocketException (0x80004005): No such host is known

Server stack trace:
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
   at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.TestTools.Controller.IControllerEvents.ControllerEvent(TestMessage report)
   at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.<>c__DisplayClass1d.<CallListeners>b__19(IControllerEvents eventListener)
   at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer`1.InvokeAsRemoteUser(Action`1 invoke)
   at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.CallListeners(TestMessage testMessage)

The “No such host is known” exception is too general and I didn’t find any more information on the web on how to find my recording problem.

I was running the manual test recording from my laptop which at that time was connected through VPN to the office. I decided that VPN could eventually give some networking restriction, so I tried running test recording from another machine that’s located inside the office. Not surprisingly though this machine produced the same error.

What come to surprise to me is that this time the error in Event Log on Test Controller machine was slightly different:

(QTController.exe, PID 1368, Thread 34) ControllerExecution: Exception: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.xx.xx:50086

Server stack trace:
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
   at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.TestTools.Controller.IControllerEvents.ControllerEvent(TestMessage report)
   at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.<>c__DisplayClass1d.<CallListeners>b__19(IControllerEvents eventListener)
   at Microsoft.VisualStudio.TestTools.Execution.RemoteObjectContainer`1.InvokeAsRemoteUser(Action`1 invoke)
   at Microsoft.VisualStudio.TestTools.Controller.ControllerExecution.CallListeners(TestMessage testMessage)

The IP 192.168.xx.xx is the address of where I run MTM client and after reading the cause of this error in Troubleshooting errors in lab management, everything suddenly got crystal clear to me.

The way MTM works is contacting Test Controller machine and initialize it. Then Test Controller is trying to open a socket back to the MTM recorder. You can see that by running “netstat -nab” on the MTM machine and look for something like this:

TCP    0.0.0.0:50086          0.0.0.0:0              LISTENING
[mtm.exe]

So in order to fix all errors of this kind you must make sure that your Test Controller can connect to the machine running MTM. In my case – the second error was produced because MTM machine was blocking the port because of the firewall. The first error was produced because MTM machine is a VPN client and it doesn’t get registered and resolved in DNS. In order to workaround this, I created a record to my VPN client in hosts file at Test Controller machine.

I’ve got it all running except IntelliTrace data collection which I will blog in separate post.

Labels: , ,


# posted by Martin Kulov @ 4:14 PM

Share |


|




March 03, 2010

Windows 32 bit RAM Limit (part 1)

I just upgraded my Lenovo R61 laptop from 3GB to 4GB. After the upgrade Lenovo technician showed me that BIOS was saying - 4GB memory installed. When I started Windows 7, I fired up Task Manager and I can see that Total Physical Memory was 3,096MB or just 3GB. When I ask the technician what is wrong, I got the answer –“Well, Windows 32 bit can only show up to 3GB. If you need to use 4GB you need to upgrade to Windows 7 64 bit.”. My first reaction was - “But wait, 32 bit means that overall 4GB of memory can be accessed, right? So why do I only see 3GB of total memory.". Then he said something about memory bus, addressing and Windows hardware support, and final line was - “Well, I need to calculate how big exactly is 32 bit number”. At this point it was clear to me that I need to figure out the issue by myself.

Looks like Windows 2000, XP, Vista and 7 support 4GB in their 32 bit version as written here: Memory Limits for Windows Releases.

However displaying that information is a little bit tricky as it has been changed from Windows Vista to Windows Vista SP1.

Windows Vista (with SP1 installed) or later will show you the total physical memory installed on the machine (Windows Vista SP1 includes reporting of Installed System Memory (RAM)) by going to Control Panel/System or My Computer/Properties window. On my machine (Windows 7) this is what I see:

Installed memory (RAM): 4.00 GB (2.99 GB usable)
System type: 32-bit Operating System

Windows Vista (without SP1 installed) will show you the actual memory available to Windows due to reserved memory-mapped I/O (MMIO) as the following article explains:

The system memory that is reported in the System Information dialog box in Windows Vista is less than you expect if 4 GB of RAM is installed

For example, if you have a video card that has 256 MB of onboard memory, that memory must be mapped within the first 4 GB of address space. If 4 GB of system memory is already installed, part of that address space must be reserved by the graphics memory mapping. Graphics memory mapping overwrites a part of the system memory. These conditions reduce the total amount of system memory that is available to the operating system.
The reduction in available system memory depends on the devices that are installed in the computer. However, to avoid potential driver compatibility issues, the 32-bit versions of Windows Vista limit the total available memory to 3.12 GB.

Regardless of how Windows reports memory available, the real available memory to Windows seems to be constrained to 3.12GB on 32bit version of Windows and this is what Task Manager is actually showing.

Read more about this constraint on Windows memory FAQ.

There is an option to make Windows 32bit to “see” memory over 4GB that is called Physical Address Extension. However this option is more like software mapping of memory regions and has lots of issues with device drivers.

Let’s move to our next article in this research - Pushing the Limits of Windows: Physical Memory by Mark Russinovich. In his article Mark give a nice wrap up of our problem so far:

While 4GB is the licensed limit for 32-bit client SKUs, the effective limit is actually lower and dependent on the system's chipset and connected devices. The reason is that the physical address map includes not only RAM, but device memory as well, and x86 and x64 systems map all device memory below the 4GB address boundary to remain compatible with 32-bit operating systems that don't know how to handle addresses larger than 4GB.

However it is interesting to see that Mark’s machine has a little more memory available:

Installed Physical Memory (RAM) 4.00 GB
Total Physical Memory 3.50 GB

You may think that you should never install 32bit system with 4GB of RAM, however this comment from Anna N on Mark’s post put me into thinking:

Yes, there's a reason to have 4GB under 32bit OS, and that is because most graphic cards have 512MB or less, so even after drivers' memory holes you have usually much more than 2GB available, and that's useful for caching (so for casual usage, too), especially under Vista. 4GB is (on current platforms) better than 3GB because of dual channel memory so 2x2GB means better memory performance than 2GB+1GB. This may change on triple-channel Nehalem, maybe 3x1GB will be better.

Looks like even though I cannot use this 1GB I just bought, still my memory works now in dual channel mode which is faster than previous configuration.

So the question that we are left so far with is “How I can see what is taking up my memory between 3GB and 4GB memory range and is there a way to use some parts of that area?”.

These 0.5 GB difference of memory in my machine and Mark’s are about 12% of the total memory and it can really make the difference for my heavily used laptop.

I will continue my research in part 2 of this post.

Labels: ,


# posted by Martin Kulov @ 12:41 AM

Share |


|




February 04, 2010

Speed up ASP.NET compilation

If you do ASP.NET development on a daily basis, you know that any change in bin, App_Code folder as well global.asax invalidates all compiled assemblies and initiates a full recompile. This can be very tedious process, especially if you are changing these files a lot during development.

Microsoft introduces a new web.config setting that prevents full recompile in such situations. The setting is added through a QFE (patch) to Windows XP and Windows 2003, Vista and Windows 2008, and is included in Windows 7 by default.

You can enable this optimized setting by the following section:

<compilation optimizeCompilations="true">

Read the complete article to find out the possible issues you may run into.

I wouldn’t recommend this setting for production web sites as it can introduce runtime errors. Even if you web site is so big that it takes 10 min to recompile it all, chances that you are running in web farm environment are pretty big these days. Shutting down one of the web farm servers until the compilation process completes, shouldn’t be such an issue. After all how many times are you going to apply updates on the production server? In situations where you are not using your production server for staging and test environment, updates will be most probably applied once per week even less.

In development environment this switch can change your life. Again, keep in mind the possible implications caused by this setting as described in the article above.

Bonus tip: In ProPeople we are also using RAMDisk to redirect ASP.NET temporary files into it. This way all ASP.NET temporary files get created amazingly fast (in-memory) and greatly speeds up your debugging experience.

Labels: ,


# posted by Martin Kulov @ 2:02 AM

Share |


|




October 26, 2009

Windows 7 Tips

Coskun Sunali sent me a list of 77 tips for Windows 7. While some of the tips are already included in Windows Vista and Windows Server 2008, it is still a good reference to all of them. Here is a short list of my favorites.

15. Prepare for DirectAccess. DirectAccess makes it easier for users to remotely access their office-based resources, without a VPN. DirectAccess also opens up remote computers more fully to Group Policy—but it requires Windows 7 and Windows 2008 R2.

21. Presentation Nirvana. Press Windows+P to access the new Presentation mode, and easily turn on your projector and laptop screen at the same time. No more messing with vendor-specific utilities and arcane keystrokes. (Windows+X accesses the Mobility Center, with additional presentation options.)

22. Cut the Clutter. Press Windows+Home to minimize all but the current window, removing background clutter and letting you focus on that report your boss has been bugging you about.
 
23. Be a Mouse-Click Administrator. Windows 7 makes it easy to gain admin rights with a keyboard shortcut. Click on Ctrl+Shift on a taskbar-locked icon, and voila! You've launched it with appropriate admin rights.

29. RoboCopyCopyCopy. The always-useful Robocopy.exe can now run multi-threaded; run Robocopy /? to review its new parameters (like /MT for multithreading) and make your copies go faster.

35. Simplify Cloned Machine Setups. You can't run Sysinternals' newsid utility to change the identity of a cloned Windows 7 machine (either a virtual machine or imaged PC). Instead, create a template installation then run sysprep /oobe /generalize /reboot /shutdown /unattend:scriptfile. Clone or copy this virtual machine file. When it launches, it will get a new SID and you can fill in the name. The reference for building unattended script files is at tinyurl.com/winunattend.

46. Encrypt USB Sticks. Use BitLocker To Go. Maybe you've managed to never misplace or lose a USB key, but for the rest of us mere mortals, it's a fact of life. Most of the time it's no big deal, but what if it contains sensitive data? BitLocker To Go enables you to encrypt data on removable storage devices with a password or a digital certificate stored on a smart card.

Labels: ,


# posted by Martin Kulov @ 11:51 AM

Share |


|




September 30, 2009

Microsoft Bulgaria DPE blog

Since recently, Microsoft Bulgaria launched a blog for news and events in the Development Platform area.

Make sure that you subscribe to the RSS feed and you will receive important information about new releases from Microsoft and related events in Bulgaria.

You can find the blog here:

http://blogs.msdn.com/dpe_bulgaria/

Labels:


# posted by Martin Kulov @ 2:48 AM

Share |


|




August 19, 2009

How to Find if Virtualization is Running in Virtual Server

If you still have Virtual Server running, I would definitely recommend that you first migrate to Windows Hyper-V :)

However for the rest of us living in the real world, there is a cool trick to check if virtualization is actually running for your virtual machine.

You need to see the value of the following performance counter on the host machine, not the guest:

Virtual Processor\fVpProcessorInHvmMode

or also found as

Virtual Processor\HVM-VP is in HVM Mode

You can read more how to enable Hardware Virtualization in Virtual PC and Virtual Server in this article.

Labels: ,


# posted by Martin Kulov @ 2:03 AM

Share |


|




August 09, 2009

Search string in SQL Server database

How you can find a string in a SQL database? One option would be to export the database to Excel file and use the Excel searching capabilities. Unfortunately I did not manage to get the export working for me at all. If you want to do it the smart way, here is a query that search all tables and columns in a database written by from Vyas Kondreddi. Another one is available for replacing string in a database.

Labels: ,


# posted by Martin Kulov @ 1:38 AM

Share |


|




July 20, 2009

Migrating TFS 2008 Project Portal

I had a strange problem last week. I was trying to access the WSS portal site for one of our TFS projects. We migrated the TFS to a new domain and the portal site was working before that.

However now I’ve got the lovely “404 NOT FOUND” message. More interestingly when I tried to create a new site collection with the same name, WSS told me that the site is already created. I could not see that in the site collection list page though.

By pure luck I decided to use the command line tool stsadm to enumerate all the existing site collections. I found that my site is already created indeed, however the owner of the site was an user from our old domain. What I did is basically change the owner to the correct domain and user, again using the stsadm tool, and volla – I was able to access the TFS project portal site again.

Labels: ,


# posted by Martin Kulov @ 1:54 AM

Share |


|




May 25, 2009

Connect to TFS 2010 from VS2008

If try to connect to TFS 2010 instance from Visual Studio 2008 you will probably experience the following error message:

Possible reasons for failure include:

  • The Team Foundation Server name, port number or protocol is incorrect.
  • The Team Foundation Server is offline.
  • Password is expired or incorrect.

The trick is that due to changes in TFS 2010 architecture, you now have to enter a full URL to connect to the server. This URL have to include a TFS virtual directory in it. So at the end the URL will something like this:

http://tfs2010:8080/tfs

This will connect you to the default collection of the TFS 2010 server.

Labels: , ,


# posted by Martin Kulov @ 11:01 PM

Share |


|




May 09, 2009

Boot from VHD

Windows 7 and Windows 2008 R2 has the possibility to boot from VHD. Ideally this will make your VM run with the smallest overhead possible from the host system. It should be interesting to try out Windows Server 2008 Server Core and see how much is the memory footprint. Actually this article "Deploying and Maintaining Server Core" claims that the actual footprint they have is 1.6GB HDD and 180MB RAM.

Find out how to make Windows 7 and Windows 2008 R2 boot from VHD file in this step by step guide "Windows 7 - Natively Booting from a .VHD file (Virtual PC image)" and in the video Windows 7 VHD Boot Demonstration.

There are some restrictions though. Watch out for the following:

  • You can only boot a Windows 7 or Windows Server 2008 R2 VHD
  • You must configure the boot editor from a Windows 7 or Server 2008 R2 install
  • You cannot use a Virtual PC VHD, I suggest a Hyper-V VHD
  • You need to start with a clean slate, don’t try and reuse an old VHD
  • as stated in the article "Windows 7 Boot From VHD".

    Labels:


    # posted by Martin Kulov @ 5:13 PM

    Share |


    |




    March 29, 2009

    Breakpoints in multithreaded applications

    There are known problems in Visual Studio 2008 SP1 related to breakpoints and debugging experience with multithreaded applications. Since these days almost everything that you write is multithreaded app, I would recommend you to install the hotfix from MSDN Code Gallery.

    Here are the possible symptoms:

    • Breakpoints in parallelized loops are eventually ignored after multiple hits
    • Stopping and starting threads causes breakpoints to be missed
    • Visual Studio may crash when you debug multiple processes at the same time
    • Stepping over a disabled breakpoint when you debug a native application turns into a "go"
    • Stepping when you debug a managed multithreaded application can randomly turn into a "go"
    • Visual Studio crashes when you use the "Step Into" command to start an MPI program
    • Running the "Step Over" command while you are debugging multiple processes causes a deadlock
    • Disabled breakpoints are not visible after you install Visual Studio 2008 Service Pack 1

    Labels: ,


    # posted by Martin Kulov @ 4:37 AM

    Share |


    |




    March 15, 2009

    Empty Blogger RSS feeds

    I experienced some downtime on my blog due to some problem with Blogger FTP publishing feature. It is unfortunate to see that Blogger is not able to handle forum support anymore except major percent of the blogs stop working.

    My atom.xml and rss.xml files were having 0 file size although the internal blogger rss feed for my site was working. I fixed the problem by going to Settings/Site Feed and placed a leading dot (.) before the slash. So your path will start with "./".

    I hope this works for you!

    Labels:


    # posted by Martin Kulov @ 2:07 AM

    Share |


    |




    January 28, 2009

    VS 2010 September CTP download

    Do you want to try the new branching features in the upcoming VS Team Foundation Server and .NET 4.0? Do you want to see the new WPF based editor in VS 2010? Do you want to try out the new historical debugger?

    These features and also many more are available for free trial download from Microsoft.

    Please note that these images expire on 1 Jan 2009 so you need to run off the time synchronization in VPC or Hyper-V.

    There is also Visual Studio 2010 and .NET Framework 4.0 Training Kit.

    You will also need the following passwords to login to the VPC:

    • Administrator: TFSSETUP, password: 1Setuptfs (use this account to explore the CTP)
    • Administrator: Administrator,password: P2ssw0rd
    • User: TFSREPORTS, password: 1Reports
    • User: TFSSERVICE, password: 1Service

    Labels: ,


    # posted by Martin Kulov @ 1:52 AM

    Share |


    |




    January 23, 2009

    TypeInitializationException in EPiServer CMS SP3

    I recently got the stack trace below in one of the web sites that we are building.

    The site is running EPiServer CMS and it seemed that the problem is caused by a change in the module loading logic in EPiServer CMS SP3.

    Quote from SP3 Uppgrading problems post in EPiServer Forum.

    With SP3 there was some remodelling in how a EPiServer handles the initialization of the application.

    These changes however made it so that it's not possible to hook into the datafactory events in Application_Start.
    Instead we first hook into Application_FirstBeginRequest and then we have a instance of the DataFactory to work with.

    Debugging the problem was a little PITA, because of all these static and non static constructors that just fail to load and eventually hide the real exception. Instead a more general TypeInitializationException is returned.

    As the commercial says: Do not this at home. Avoid putting logic that loads resources and does some heavy work in the constructors, either non static or worse – static ones. You will spend hours debugging such a code.

    Here is the stack trace itself:

    Server.GetLastError() returned System.TypeInitializationException: 
    The type initializer for 'EPiServer.DataAbstraction.UnifiedPathInfo' threw an exception. --->
    System.TypeInitializationException: The type initializer for 'EPiServer.CacheManager' threw an exception. --->
    EPiServer.BaseLibrary.ClassFactoryException: ClassFactory not initialized
       at EPiServer.BaseLibrary.ClassFactory.get_Instance()
       at EPiServer.BaseLibrary.ClassFactory.IsRegistered(Type baseType)
       at EPiServer.CacheManager..cctor()
       --- End of inner exception stack trace ---
       at EPiServer.StaticCacheKey.EnsureKey()
       at EPiServer.StaticCacheKey..ctor(String keyName)
       at EPiServer.DataAbstraction.UnifiedPathInfo..cctor()
       --- End of inner exception stack trace ---
       at EPiServer.DataAbstraction.UnifiedPathInfo.Load(String path)
       at EPiServer.FileSystem.DefaultAccessControlList..ctor(String path)
       at EPiServer.Web.Hosting.DirectoryAccessControl..ctor(String virtualPath)
       at EPiServer.Web.Hosting.UnifiedDirectory.get_DirectoryAC()
       at EPiServer.Web.Hosting.UnifiedDirectory.QueryAccess()
       at EPiServer.Web.Hosting.UnifiedDirectory.QueryDistinctAccess(AccessLevel access)
       at EPiServer.Web.Hosting.VirtualPathVersioningProvider.GetDirectory(String virtualPath)
       at EPiServer.Web.Hosting.VirtualPathHandler.InitializeProviders(ProviderSettingsCollection providers)
       at EPiServer.Web.InitializationModule.InitializeVirtualPathProviders(VirtualPathElement vpElement)
       at EPiServer.Web.InitializationModule.Initialize(EPiServerSection config, Settings settings,
    ConnectionStringSettingsCollection connectionStringSettings)
       at EPiServer.Web.InitializationModule.StaticInitialization()
       at EPiServer.Web.InitializationModule.Application_BeginRequest(Object sender, EventArgs e)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Fixing this was actually easy, finding the root of the problem.


    I wrote a small module that makes the required initializations that did not have a chance to start yet. It looks like this:

    public void Init(HttpApplication context)
    {
        EPiServer.Web.InitializationModule.Initialize(EPiServer.Configuration.EPiServerSection.Instance,
    EPiServer.Configuration.Settings.Instance);
    if (!EPiServer.BaseLibrary.ClassFactory.IsRegistered(typeof(EPiServer.Diagnostics.ITransformer)))
        {
            EPiServer.BaseLibrary.ClassFactory.RegisterClass(typeof(EPiServer.Diagnostics.ITransformer),
    typeof(EPiServer.Diagnostics.DefaultTransformer));
        }
    }

    No guarantees it will work for you though :)

    Labels: ,


    # posted by Martin Kulov @ 3:38 AM

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




    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

    Share |


    |




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

     








    Recent posts



    Locations of visitors to this page



    History




     
    Copyright © 2004-2008 CodeAttest Ltd. All Rights Reserved.
    <%-- Google Analytics code --%> <%-- Google Analytics code --%>