Problem in Debugging and installing Window NT Service created in VC++
I have a legacy service which was developed in VC++ 6.0 and right now maintained using Visual Studio 2008.
It handles database operations and provides records to its JAVA client in a predefined (XML) format.
When we install JAVA application the service automatically开发者_如何学运维 gets installed (through JAVA application's installer).
To debug this service I want to proceed as per the following steps: 1) Build the service 2) Install the service using installutil.exe - the service should appear in service control manager (services.msc) 3) Start the service from SCM 4) From Visual Studio 2008 Debug -> Attach to Process, select the running service and click "Attach".
I am stucked at step 2.
I have successfully built the debug version of the service. But when I try to install the service using "installutil.exe" from Visual Studio 2008 Command Prompt, I am getting the following error:
Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///D:\MyService.exe' or one of its dependencies. The module was expected to contain an assembly manifest..
Can anyone help me in proceeding further?
Is there any other better way to debug the service?
Try using Dependency Walker to diagnose what is missing. Also check the event log, I believe when a file fails to load due to manifest issues 3 error events are added to the system event log.
精彩评论