My console app needs .NET Framework 2.0??

J

jbcseri

If there is a better forum to post my issue, please let me know. This
is more of a Visual Studio development question than an XPe question,
but I figured that someone here might know exactly what I need to do.

Since the AutoRestartShell registry value is ignored when using
Winlogon with a custom shell, I followed the advice given from this
newsgroup and created my own watchdog application (see
http://groups.google.com/group/micr...18f40?lnk=st&q=&rnum=1&hl=en#039758d940718f40).
I created my watchdog app on my Windows Vista laptop with Visual
Studio 2005 and it works fine on that machine. When I transfered
the .exe to my XP Pro development system, where I have my XPe
development environment set up, the application won't run. I also
tried running it on an XPe build that I did, only to have the same
result.

My watchdog app is very simple. It calls CreateProcess and
WaitForSingleObject in a loop so that the shell application that the
watchdog app launches will automatically restart when it is
terminated. When I ran the watchdog application through depends.exe on
my XP Pro system, it indicated that it could not find MSVCR80.dll.
When I searched in the XPe database for MSVCR80.dll, the component
which brings it in is .NET Framework 2.0, so I'm assuming that somehow
my very simple application is dependent on .NET 2.0.

Do I really need to include .NET 2.0 in order to run my simple app? Is
there a setting in my Visual Studio watchdog workspace that will not
require .NET 2.0 to be on the system in order for the app to run?
 
K

KM

Nope. You don't need to include the entire .Net 2.0 component.
You can just copy the MSVCR80 library under the system path of your image. It is a known issue since Beta of FP2007. There should've
been a primitive for the MSVCR80 but it is not there.

The other side of the problem is that if you use latest VS, it will always (by default) link application to the latest runtime
library which is MSVCR80 for VS2005. You can verify that by looking at the manifest of your application that is built along with the
Exe.

You can switch to older versions of the runtime library (MSVCR60, etc.). Then you will have to manually change your linker options
of VS project.
 
J

jbcseri

I am actually trying to run my app under XP Pro before trying it on
XPe. I copied MSVCR80.dll to \Windows\System32, but the app still
doesn't run, producing the error message "The application has failed
to start because the application configuration is incorrect.
Reinstalling the application may fix this problem (14001)." Perhaps
there is another VS2005 setting that I need to change.

Also, I don't know exactly how to go about switching the linker
options to use an older version of the run-time library. I've been
looking at the VS2005 project properties, but I can't find where to
make the change.
 
K

KM

From the error message I'd say that you are missing Side-by-side components. But lets first fix what's obvious. Here is my
suggestions that you may want to do all or each one alone:

- Please also copy the manifest along with your application exe. This will make sure it will use the right dependencies
versions.

- From your app description it sounded it is simple enough to use only basic Win32 API and you may not need the CRT libraries at
all. The MSVCR80 may get linked however if you have "Multi-Threaded DLL (/MD)" or "Multi-Threaded Debug DLL (/MDd)" option set for
the Runtime Library on the Code Generation tab in the C/C++ branch of the Project Properties in VS2005. Just use the single-threaded
Dlls there and disable Exceptions. Or, alternatively, just link statically to the library to remove the dependency at all (use
"Multi-Threaded (/MT)" option for instance).

- Make sure to include side-by-side components in TD.

- Run the application through DependencyWalker on the target devices , more precisely - run it through Profiler of the
DependencyWalker. Then you should be able to see why it's failing to load.

- Along with the msvcr80.dll please also copy over msvcm80.dll and msvcp80.dll libraries + CRT lib manifest from VS2005 on XP
Pro machine where you run the tools (somewhere under "\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT").

- If the above doesn't help, install VS2005 (x86) Redist package at runtime:
http://www.microsoft.com/downloads/...EE-A3F9-4C13-9C99-220B62A191EE&displaylang=en

- Make sure you are working with the proper version of the libraries corresponding to the project settings - Debug or Release.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top