Water Cooler v2
Water Cooler v2

Reputation: 33880

Class library assemblies used by Windows Services written in C#

If I write a C# class called Foo and that is compiled into an assembly named FooLib.dll. Then, I write a Windows Service in C# that references FooLib.dll. When I deploy my Windows Service using InstallUtil.exe:

a) do I have to explicitly tell it to reference my FooLib.dll?

b) where does FooLib.dll get deployed if I mean to deploy it as a private assembly and not in the GAC?

Upvotes: 0

Views: 1199

Answers (1)

Ashish Gupta
Ashish Gupta

Reputation: 15139

You can just place the FooLib.dll in your Windows service target directory and that should do.

For example, If your service named "MyService" is pointing to c:\folder1\MyService.exe, put the FooLib.dll in c:\folder1.

Ideally, you put the exe which is going to be the windows service and all its dependecies in one "deployment" folder and then run installutil on <PathToTheDeploymentFolder>\MyService.exe.

Upvotes: 2

Related Questions