Showing posts from March, 2011

Dumpbin - Checking Your Application Compiled Platform (x86 vs x64)

dumpbin is a program in Visual Studio Tools that helps you to display information in binary file. I find it useful to check whether a dll is build for x86 or x64.
Corflags is good for checking .exe, and soon, you will realize that it is not effective on checking dll files. Especially for unmanaged dll, you will see this error message
corflags : error CF008 : The specified file does not have a valid managed header A better way is to use dumpbin with /headers options.
1. Go to start menu, find your VS2010 application folder
2. In Visual Studio Tools, click on Visual Studio Command Prompt (2010)
3. A command prompt environment will be load.
4. Navigate to your assembly location. Type, dumpbin /headers your_assembly.dll. It will display the following for x86 dll and x64 dll respectively. See the highlighted areas

VS2010 - LINK : fatal error LNK1104: cannot open file ""

I don't know why this would happen even when is created by VS2010, no permission issue and VS2010 is run as Administrator. The is 0 bytes.
The solution that work for me is to set Enable Incremental Linking to No.
1. At Solution Explorer, right click your project and click properties
2. Navigate to Linker -> General -> Enable Incremental Linking. Set to No (/INCREMENTAL:NO)
3. Click Apply and Ok

Corflags - Checking Your Application Compiled Platform (x86 vs x64)

The CorFlags Conversion tool allows you to configure the CorFlags section of the header of a portable executable image. It can also be use to check if your exe or dll is compiled under x86, x64 or Any CPU platform.

Corflags.exe come with VS2010. Use it as follow
1. Go to start menu, find your VS2010 application folder
2. In Visual Studio Tools, click on Visual Studio Command Prompt (2010)
3. A command prompt environment will be load. Type corflags will display something like follows

4. Navigate to your assembly location. Type, corflags your_assembly.exe. It will display the following

5. You will only be interested in PE and 32BIT flag. Refer to the following tables for their meanings
anycpu: PE = PE32 and 32BIT = 0 x86: PE = PE32 and 32BIT = 1 64-bit: PE = PE32+ and 32BIT = 0 6. As my assembly is compiled for x64 platform. Its PE is PE32+ and 32BIT is 0

Visual Studio 2010 - Microsoft.Data.Entity.Design.BootstrapPackage Load Error

If you see the following warning, it means that there is some problem with your VS2010 installation. I believe I encounter this simply because I uninstall VS2010 after my first fresh install.

Regardless the reason, general fix is to uninstall, remove some registry and reinstall. This is a tedious process!!
I tried the following method and work for me to save some time
1. Open Register Editor, regedit 2. If you are 32 bit Window, remove the following
a) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AutoLoadPackages\{adfc4e66-0397-11d1-9f4e-00a0c911004f}, locate and remove the REG_DWORD {7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB} b) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AutoLoadPackages\{93694fa0-0397-11d1-9f4e-00a0c911004f} , locate and remove the REG_DWORD {7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB}
c) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Packages\{7A4E8D96-5D5B-4415-9FAB-D6DCC56F47FB} and delete this key3. If you a…

Linux - md5sum

A good way to generate and list MD5 Sum within the folder

find -type f -exec md5sum {} \;

Window Virtual PC - Slow File Transfer

When you trying to transfer a file to your Window Virtual PC, you experience extremely slow network transfer (10 - 30 kbps). On a normal NIC, this should not be the case in a un-congested LAN environment. This is mostly likely due to TCP large send offload is turned on.
TCP large send offload turned on means that TCP segmentation is being done at the NIC card. Usually, it will be done at the protocol stack. This is a problem for Window Virtual PC because it does not implement TCP segmentation at NIC card.
You can check your current offload status by using the following command at Command Prompt
netsh int ip show offload
The following will be displayed
ipv4 transmit checksum supported. udp transmit checksum supported. tcp transmit checksum supported. tcp large send offload supported. tcp giant send offload supported.
TCP large send offload supported means that your TCP large send offload is turned on at your NIC.
To turn it off, a lot of people ask you to do the following
1. Go to Control Panel\Ne…

Win7 - Running script on command prompt

I am not sure to love it or hate it. The security setting in Win 7 is getting on my nerve. Prompting me this and blocking me that.

This is also a problem running script such as VB script in command prompt.
I encounter the following error when running my VB script to create a user in Active Directory
Active Directory: Access is denied My account running the command prompt is administrator, but yet, it is saying I do not have the access right.
The main reason is Win 7 (security reason) run application without administrative right. As per they recommended, you should log in as normal user and use Run as administrator (right click on the exe) whenever you want to run the application.
The same reason applies to running script on command prompt. You need to use runas command. For example, to run a script with account admin, you can do the following
runas /profile /user:domain_A\admin "cscript.exe C:\add_user.vbs"
You can use the following to runas current user
runas /profile /u…

Win7 - AdobeUpdater No Internet connection was found

This happens when you AdobeUpdater is running and the response is No internet connection was found. Please check your Internet setinngs or firewall
Apparently, this issue is not necessary due to Internet or firewall.
A possible solution to this is a follow
1. At Window 7, go to Control Panel 2. Locate Network and Internet and click on the link 3. Locate Network and Sharing Center and click on the link 4. At the side bar, locate Change adapter settings and click on the link 5. You will see a list of network interface. Switch to detail view for this page. 6. Look for a device name - Microsoft Virtual Wifi Miniport Adapter. Right click and disable it. 7. Run AdobeUpdater again. It should work.


Normally, RTSP provide streaming over UDP. By nature, UDP is a better choice as it provides robust streaming capability for media. However, it is unlikely to use UDP for streaming over the Internet.
Some issues with UDP are
1. RTSP/RTP over UDP requires many UDP ports to be opened (each media stream requires 2 UDP port for data and control). 2. Point 1 is a real problem as routers in the Internet may not open these ports. 3. It is normal for intermediate Internet router to filter and ignore UDP packets. 4. UDP is unreliable. Media packets may be lost when travelling along the Internet

RTSP/RTP over TCP may resolve this issue.
1. RTSP/RTP will communicate via 1 port for command and data. That is the RTSP port. 2. TCP provide reliable streaming 3. It is more likely that the intermediate Internet router allow these TCP packets to go through.
Using RTSP/RTP over TCP come with a price.
1. It complicated the packetization and depacketization process due to binary interleave. 2. TCP is reliable but…

RTSP - Real Time Streaming Protocol (RTSP)

RFC 2326 define the specification for RTSP, Real Time Streaming Protocol.
RTSP is mainly use for setting up streaming and control for audio and video media. As an overview, RTSP will be used with RTP over UDP or TCP. In this entry, I will describe the how to use RTSP as media setup command
The common commands for RTSP is OPTION, DESCRIBE, SETUP, PLAY, TEARDOWN.
The above commands set is enough to connect or disconnect from a media stream. I will briefly describe each commands
OPTION command is used by client to ask server what type of commands does it support. The request and response example is

DESCRIBE is used by client to ask server to provide media stream information for a certain media URL Commonly, the DESCRIBE command provide the SDP, Session Description Protocol, for the given media URL. The request and response example is
SETUP is used by client to setup necessary port, track, etc for a given media stream. It is used to tell the server what type of transport, UD…