|
Template comparison: - VS 2005 + Orcas extensions: WCF Service (from New Web Site)
- VS 2008: WCF Service (from New Web Site)
The new template for WCF Service when generating a new web site in VS 2008 has not changed much. The main difference is the naming convention of project files generated, the separation of service contract and service type files, and the sample service contract and service type code is slightly different. Impact to Learning WCF labs: Anywhere I ask you to create a new web site using the WCF Service, you should continue to do so. The difference will be in the file location where the service contract and service type is located. - When I ask you to modify the name of the .svc file, or modify the @ServiceHost directive, nothing changes - follow the instructions as written.
- When I ask you to delete the generated service contract and service type, you will now have two files to delete instead of just one, in the App_Code directory.
Summary of WCF Service web sites in VS 2008: When you want to host a WCF service in IIS you will turn to the web site templates for WCF. In VS 2008, the same web site template exists for WCF services - the WCF Service template. The following dialog shows creating a file-based web site using this template: I recommend using this template in the following scenarios: - When you are not able to run IIS on the machine. Some corporate environments have this limitation on developer machines. Personally, I think this is a mistake because it also means developers can't test real security behaviors (as in the identities that must be configured so that services can talk to database, etc.)
- When you are not testing security and just want a simple solution you can distribute. For example, when I build code samples it makes them easier to distribute I usually use file-based web sites. That saves you the trouble of creating a virtual application in IIS to run the sample, and generally makes them easier to distribute to folks if they have IIS or not. I can't do this for samples the work with certain security settings in the bindings, however.
You can also create web sites in IIS selecting this template: The end result is the same as you expect with Orcas extensions in VS 2005. The project includes a .svc endpoint with a sample service contract and service in the App_Code directory. The main difference is that now the contract and service are separated into different files (IService.cs and Service.cs): Technorati Tags: WCF, VS 2008
|