Wednesday, November 30, 2005

Find whether a .NET assembly is Release or Debug build

Bangalore
1 Nov 2005

Applies to : VS.NET 2003

Many a times, I would be at the mercy of the developers to do a release for me. This lead to the question; how do I know if they have done a release or debug build.

Since there was no straight forward answer to find this out. I decided to use the AssemblyInfo.cs file to help me out.

But which attribute should I use....

After probing the properties of an assembly (dll) file. I came to a conclusion that the best place to put it is the AssemblyProduct attribute.

So using a combination of pre processor directives I was able to accomplish my goal.

The code snippet is as follows.


#if DEBUG
[assembly: AssemblyProduct("Product Name [Debug Build]")]
#else
[assembly: AssemblyProduct("Product Name [Release Build]")]
#endif

Musing
It would be really great if a generic assembly attribute can be created which takes in any attribute name. Why?... mainly because all the attributes are name value pairs, so if I enter a custom attribute it should also be displayed under the files Properties - Version Tab.

Tuesday, November 29, 2005

Generic Host Process for Win32 Services

Bangalore
30 Nov 2005

It was a shocker to get an error "Generic Host Process for Win32 Services" when I restarted my PC.

My initial reaction was that I was infected with a virus. This was proved wrong by the Norton Anti virus software with the latest virus update (Not that I trust Norton to come up with updates even before the problem is encountered).

Then the usually feedback window came up which is present under %windir%/system32/dwwin.exe (a Microsoft application error reporting tool).
At first even this looked odd and had to be confirmed with peers if its a genuine tool or another spy ware. It was found to be genuine.
Upon submission only once did the IE open up and suggested that there is a fix for it, after which the System hanged.

On probing the history next time before the error occurred in safe mode the URL was found to be.
http://support.microsoft.com/?kbid=894391&SD=tech
Was so relieved that there was a fix for it. But wait...

The problem was still the same, no remorse... on top of that the windowsupdate.microsoft.com was also down (29 - Nov 9PM IST - 30- Nov 12 PM IST)
Then the error had to be probed further and found a dll called hlcap.dll this search on google gave just one result (amazing). Pointing to.
http://jfw.id.au/

The solution was to remove HTTPLook from the XP machine and viola everything was back to normal.

I now have to wait for Microsoft to update their System to have this great software installed back again :(

I had to thank him and also increase the count next time when google searches and this is the result.

P.S
HTTPLook is a product from http://www.httpsniffer.com/ which helps you to track http request and responses going in and out of your IE (browser) or any Internet enabled application.