Sunday, May 9, 2010

Who is the leader of the mobile computing?

1. Apple
- Very strong client product
- Very strong server product

2. Google
- Very strong server product
- Building the client (what is it client?)

3. Microsoft
- String server product
- Weak client
- Strong desktop product

Try ChromeOS

Burn a Chrome to a USB disk and start your PC from there.
Download it here http://chromeos.hexxeh.net/.

Wednesday, May 5, 2010

C#: Exception in using () {...}

We know in C#, "using" will call Dispose() of the object at the end of its scope. What will happen if an exception happens? the Dispose() will still get called?

Yes.
When?
When the fist catch is met.

Tuesday, May 4, 2010

Fixed .NET framework 4.0 error when installing Visual Studio 2010

The error:

- Windows 7 Pro 32bits

- I had VisualStudio 2010 RC installed successfully but removed prior to VS 2010 setup

- I have Visual Studio 2008 installed at the same PC

- My system disk is called I:, not C:

- I turned off all the anti-virus software while installing

- I got the following error in the event viewer after turning on the Installer trace:

Windows update "Update for Windows (KB958488)" could not be installed because of error 2147944003 "Fatal error during installation." (Command line: "wusa.exe "I:\7ef862549a4cbd33ceefb00d4a1c19\Windows6.1-KB958488-v6001-x86.msu" /quiet /norestart")

- I got the following error in the log:

Action: Performing Action on Exe at I:\Users\Billibit\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\Windows6.1-KB958488-v6001-x86.msu...

[5/3/2010, 22:55:12]Launching CreateProcess with command line = wusa.exe "I:\Users\Billibit\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\Windows6.1-KB958488-v6001-x86.msu" /quiet /norestart
[5/3/2010, 22:55:21]Exe (I:\Users\Billibit\AppData\Local\Temp\Microsoft .NET Framework 4 Setup_4.0.30319\Windows6.1-KB958488-v6001-x86.msu) failed with 0x643 - Fatal error during installation. .
[5/3/2010, 22:55:21]PerformOperation on exe returned exit code 1603 (translates to HRESULT = 0x643)
[5/3/2010, 22:55:21] Action complete
[5/3/2010, 22:55:21]Error 1603 is mapped to Custom Error:
[5/3/2010, 22:55:21]OnFailureBehavior for this item is to Rollback.

...

Final Result: Installation failed with error code: (0x00000643), "Fatal error during installation. " (Elapsed time: 0 00:01:24).


How to fix it?
- Use .NET Framework Cleanup Tool to remove .Net Framework 4.0
- Uninstall KB958488 from Update Windows Feature at Uninstall of Control Panel. It will ask to reboot the PC, but DO NOT reboot! immediately install .Net 4.0.

Monday, May 3, 2010

How do I debug a custom action/installer class?

You can use one of the following methods:
• Add a call in your code to System.Diagnostics.Debugger.Launch. This method opens Just-In-Time debugging and allows you to attach a new debugger to your code.
• Add a call in your code to MessageBox.Show("Debug Me"). When the message box is shown, use Visual Studio to attach to the MessageBox process. Then place breaks (for Visual C# projects) or stops (for Visual Basic projects) in the code.
• Set your debugging preferences to start InstallUtil.exe (which is located in \winnt\Microsoft.net\Framework\version) and pass it your assembly as a parameter. When you press F5, you hit your breakpoint. InstallUtil.exe will run your custom actions the same way that MSI does.

Sunday, May 2, 2010

What I want to do?

Everyday I read a lot of posts, learn a lot of new technologies, code a lot, think a lot about life, human being, and future.

I will post all of them here!