次の方法で共有


A closer look at Hello World developed using VS 2005

Okay now that I had spoken about the Hello World program, let's take a closer look at one of the common issues that might pop-up when we run an application developed using Visual Studio .Net 2005 in a machine that does not have VS 2005 installed in it.

To get this going, I created a simple Win32 console application with the following all-time famous "Hello World" line of code added to it.

printf("Hello World\n");

You may consider checking this link for help on creating a Win32 console application.

Running this on the machine that I used to develop this project brought the application into life displaying "Hello World". Just the way we would expect it to work.

Now starts the trouble. Taking this "Hello World" application and running it on a machine that does not have VS 2005 might not work the way we expect it to. The reason for this is probably that this machine does not have the Visual C++ libraries that are required to run the application developed using VS 2005.

Here is the error that I got when I ran this program on a machine that does not have the required Visual C++ libraries:

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

The other errors that we might come across are:

"The system cannot execute the specified program."

"The application failed to initialize properly (0xC0150002). Click on OK to terminate the application."

Here is a screen shot of the error:

It would be a good idea to look at the event log to get a better picture of what the issue is. When you look at the "System" event log for error messages with source "SideBySide", you would find the following in the "Description"

"Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced assembly is not installed on your system."

This application is dependent on Microsoft.VC80.CRT which is not present in this machine. All we need to do is to redistribute the required Visual C++ libraries to get this back to form, displaying "Hello World"!

Check this link for details on Redistributing Visual C++ Libraries.

Comments