开发者

Class library assemblies used by Windows Services written in C#

开发者 https://www.devze.com 2022-12-24 05:05 出处:网络
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 Servi

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号