Advertisement

05.07.2008 at 06:37PM PDT, ID: 23384817
[x]
Attachment Details

C# Service Not calling DLL right

Asked by AdelaideKoder in .NET Framework 2.0, Windows 2003 Server, Microsoft Visual C#.Net

Tags: C# Windows Service

Hello,

I have an unusual problem related to Windows Services which I havent been able to solve for a few days  and thought I should ask here.  Any help is very appreciated.

I have built a windows service on a Windows 2000 machine running .net 2.0.  I can install/deploy the service and it works fine locally.  However, when I take it to the Development box,  win 2003 sp2, it fails to work right.  A cretin dll (3rd party), Interop.HLib.dll  fails to load, and I get this error when I try to instantiate it.  

2b. ERROR: Retrieving the COM class factory for component with CLSID {FAD6B710-6AA5-11D3-A2F8-0010A4F9853A} failed due to the following error: 8007007e.8/05/2008 10:57:37 AM

 
The issues im having is that I KNOW that the DLL works fine locally but dosnt work on the dev box.  To eliminate more issues, I created my own bran new DLL compiled, then created a new Service and added the dll to the project.  I then installed that on the dev box, this time it worked.  So on one hand the Interop.HLib.dll  dosnt work but other dlls work fine.

I have thought it could be a Account permission error, but the account is that of administrator.

The only thing I can think of is that some .net 2.0 process dosnt have access to read or write to a cretin temp dir and just having the admin be able to access that dir isnt enough.  However, this doesnt explain why the newly created dll dont suffer the same issue.

Any help more then welcome.

Thanks
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
 
namespace FinalTest
{
    public partial class Service1_c : ServiceBase
    {
        public Service1_c()
        {
            InitializeComponent();
        }
 
        protected override void OnStart(string[] args)
        {
            // TODO: Add code here to start your service.
 
            eventLog1.WriteEntry("1. Start: "  +  System.DateTime.Now);
 
 
            try
            {
 
                HLib.HyServerClass hyd = new HLib.HyServerClass();
               // hyd.StartUpEx
 
                eventLog1.WriteEntry("2a. WORKS FINE: " + System.DateTime.Now);
            }
            catch (Exception e)
            {
                eventLog1.WriteEntry("2b. ERROR: " +e.Message + System.DateTime.Now);
 
            }
 
        }
 
        protected override void OnStop()
        {
            // TODO: Add code here to perform any tear-down necessary to stop your service.
 
 
 
            eventLog1.WriteEntry("3. Stop: " + System.DateTime.Now);
 
        }
    }
}
[+][-]05.07.2008 at 06:40PM PDT, ID: 21521756

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.08.2008 at 06:27AM PDT, ID: 21524420

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:17PM PDT, ID: 21541445

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.03.2008 at 08:48PM PDT, ID: 21706789

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.0, Windows 2003 Server, Microsoft Visual C#.Net
Tags: C# Windows Service
Sign Up Now!
Solution Provided By: EE_AutoDeleter
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628