tags:

views:

21

answers:

2

I have a wcf service application that has some application startup code in the app_code folder of the project. When i publish this project to my website, it deploys it with source code and app_code folder.

Is there a way to precompile the wcf app ( like an asp.net app), that includes all the dependencies and compiled code ?

i checked the web deployment package files, and even that has the source code of app_code folder.

A: 

Your best bet would be to:

  • put all your WCF service-related code into a separate class library assembly
  • deploy that assembly to the .\bin directory
  • only put your MyService.svc file (without any code-behind) to your virtual directory

With this setup, the WCF service is still being hosted by IIS, but you don't need to do any special tricks and hacks to get it to work properly.

marc_s
A: 

problem here really is that since the template for wcf does not expect app_code folder and .cs files in it, they get added as content, changing them to compile would include them in the web dll