开发者

Automate publishing of a WCF library using MSBuild

I searched and couldn't find anything releated to this topic. When using Visual Studio 2010 for a WCF library, you can right-click it and publish the WCF Library, which generates/creates the .svc and web.config file as well as deploys it. I have been trying to mimic this in msbuild and have had no success. Is this possible? I have build scripts to deploy a WCF application, website, and have had no luck using these scripts to successfully deploy a WCF library. When i do use them, it compiles 开发者_StackOverflowthe Dll's but not the .svc or web.config file. Any advice would be greatly appreciated.


Publishing WCF library is build in feature of Visual Studio which is not related to MSBuild. So unless you create your own MSBuild task or simulate behavior with using of other tasks you will not be able to do that.


You should check out Wix I believe it should be able to do what you ask, it is just a huge learning curve.


Read Vishal Joshi's blog, he's got several great posts around technologies used to deploy IIS applications (including WCF services hosted in IIS).

Web Packaging: Creating Web Packages using MSBuild

In a nutshell, the MSBuild target Package is your friend. Try building an ASP.NET or WCF Service Application using the /t:Package target on the command line.

It will create a zip file, and related .cmd file for executing, that you can then deploy using command line, or even import the .zip manually into IIS via MMC. To deploy from MSBuild you should be able to execute that 'package' against any server running the Web Deploy service.

You can also check out %WINDIR%\system32\inetsrv\appcmd.exe if you'd rather store your application metadata seperately (sitename, apppools, acls, destination directories, etc) and then write a MSBuild (or Powershell, bat file, etc) script to coordinate the work of setting up and tearing down those assets. See Getting Started with AppCmd.exe for more information.

HTH,

Z

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜