Windows Service with COM interop

  • Thread starter Thread starter Joris Dobbelsteen
  • Start date Start date
J

Joris Dobbelsteen

Is it possible to make a Windows Service that has a COM interop.

I want to synchronize my database and ISA server blocklist. The application
is quite simple and should do the trick, provided I could start the ***
thing as a Windows Service (to make the process automatic at regular
intervals).

What do I need to configure to get it installed as a service (on a
non-development box Win2k3)?

Strong names don't work: interop has no strong name...

- Joris
 
Joris,

That's not actually true. You can call TLBIMP, and strong name the
interop assembly using the keycontainer or keyfile options.

I think that a service is a bad idea for this kind of operation, because
you will have the process running, and not doing much of anything at other
times.

You should use the Task Scheduler to run your program which will perform
the update. You can create a new one from the Control Panel. Just have it
point to your executable which performs the task.

Hope this helps.
 
Nicholas Paldino said:
Joris,

That's not actually true. You can call TLBIMP, and strong name the
interop assembly using the keycontainer or keyfile options.

Just didn't know this function, thanks.
Now I have that working.

On the server I added the assembly as a trusted assembly. This made
installation complete.
I think that a service is a bad idea for this kind of operation, because
you will have the process running, and not doing much of anything at other
times.

I'm planning to let it do more soon. However I'm just trying to get it
working here step by step first.
Besided I want to try out using the Windows Services.

You solution might actually be much better afterwards...
You should use the Task Scheduler to run your program which will perform
the update. You can create a new one from the Control Panel. Just have it
point to your executable which performs the task.

Hope this helps.

It did!
Thank you.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


Joris Dobbelsteen said:
Is it possible to make a Windows Service that has a COM interop.

I want to synchronize my database and ISA server blocklist. The
application
is quite simple and should do the trick, provided I could start the ***
thing as a Windows Service (to make the process automatic at regular
intervals).

What do I need to configure to get it installed as a service (on a
non-development box Win2k3)?

Strong names don't work: interop has no strong name...

- Joris
 
Back
Top