tags:

views:

20

answers:

1

Can someone point out any tutorials that help build windows services using msbuild. Requirements : - Should not use the csproj file - Output should be the same as the publish option in Visual Studio

Updated question:

We have a project of type windows service in our solution. In this windows service, we are referencing a couple of libraries that reside on a different system (one of them is not strongly named). This solution also contains other class libraries and websites/web-apps.

I am trying to write a custom build that outputs a xcopy deployable version of the website, and a deployable version of the windows service. When I say windows service, it shows up on the Control Panel -> Services MMC.

The website build was easy via msbuild...however I am struggling with the windows service build. Until now, my fellow developers were using the right-click on the project file ,and click publish to publish the windows service. This generates a setup.exe file that helps the admins to deploy the service.

So, now here is my question:

  • I want to use msbuild to build my windows service.
  • I do not want to directly use the .csproj file in conjunction with msbuild to build the service.
  • The output my build file generates should match the output from the "publish" option (*the publish option generates a setup.exe file*)
+1  A: 

In general, "the publish option" under the covers just runs a build with /t:Publish, i.e., it triggers a different target to the normal default 'Build' one.

Can you tell us more of what you are looking for, as opposed to not looking for?

Are you looking to generate an MSI? (If so, you definitely won't be using MSBuild if you're using the built-in .vdproj system - but be careful - this means having to put VS on a build server)

Ruben Bartelink
MSI is not really what I want to do. I want to create the same setup.exe that the publish option creates but with msbuild.
Sash
@Sash: You're not explaining yourself very well. What setup.exe that what publish creates? Are you talking about ClickOnce? Are you talking about Windows [NT] services. If so, ClickOnce cannot be used for Windows Services as it does a user-mode install.
Ruben Bartelink