Link to home
Create AccountLog in
Avatar of wwwtalal2
wwwtalal2

asked on

What is the difference between WCF created using (New Project) vs. (New Web Site)

Visual Studio 2008 can create WCF in two ways:
1. New Web Site > WCF Service
2. New Project > Web > WCF Service Application

Both structures are different as shown in the attached picture.
In either cases several applications (Web & Windows) will consume the same created WCF.

What is the situations to choose one WCF creation method over the other?

Thanks.

WCF-in-VS2008.png
ASKER CERTIFIED SOLUTION
Avatar of Gyanendra Singh
Gyanendra Singh
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of wwwtalal2
wwwtalal2

ASKER

Thank you BondinASP for your effort.

I am not concerned with VS2005, I am totally focusing on VS2008 which has two different ways to create a WCF project:
1. New Web Site > WCF Service
2. New Project > Web > WCF Service Application
Which produces different structures.

My question is, what is the situations to choose one of the WCF creation method over the other?

Thanks.
answer of your question is available in your question
>> Which produces different structures

other than there is no difference between both
I am not convinced by the answer, because there are difference between them, I think the one created from the website is more secure.

but I will award you the points because of your effort.
Just in case someone comes by and needs a more direct answer...

1. Neither is more secure.

2. Historical significance
- The "WCF Service Application" project template is geared towards developer who are more comfortable with the VS 2003 "Web Application" project where a website is basically a Class Library with exposed entry points. This project classification was intentionally left out of the pre-RTM releases of VS 2005 but was later included due to user feedback.

- The "WCF Service" project template is geared towards those who want the more streamlined development approach that you find in the VS 2005 and beyond "Web Site" project type.


3. The major differences that are immediately noticeable
- The "WCF Service" Web Site project template allows you to access shared code from anywhere within the site if you put the classes in the special App_Code folder.

- The "WCF Service" Web Site project template does not require either a Solution (.sln) or Project (.csproj, .vbproj) file (even though a "hidden" Solution file is generated when you close the solution).

- "WCF Service Application" project template gives you the ability to Clean the project (just like with a Class Library or WinForms project); the "WCF Service" Web Site project template does not.

- The "WCF Service" Web Site project template does not include a "Release" Configuration out of the box (though you can more than likely create one if needed).

- The "WCF Service" Web Site project template allows you to change code while in Debug Mode. You can't be ACTIVELY debugging -- meaning stepping through your code, but once you've finished a web request and it is rendered in the browser then you can make changes to HTML or code behind WITHOUT having to restart the debugging session. This does NOT include DLL changes... if a binned-DLL is updated then it will recompile the entire project.

- The "WCF Service" Web Site project template takes a lot of the mystery out of the web.config file... most of the native .NET Framework "stuff" that you might want to use in a site are already included and properly referenced.

- The WebForm file template is slightly different in the "WCF Service" Web Site project template. Out of the box it has an assumed context that the corresponding file(s) in the "WCF Service Application" project template do not have.

- The deployment process of the "WCF Service Application" project template is much more flexible than that of the "WCF Service" Web Site project template; this is expected given the "parent" project type they are similar to.

That's all I can think of at the moment... I'm sure there's more.
Just thought about another MAJOR difference (doh!)...

The "WCF Service" Web Site project template has the option of compiling to EITHER per-page dll's or the single monolithic dll that the "WCF Service Application" project template output.

That one is a biggie... because simply replacing the dll is trivial with sites created using the "WCF Service Application" project template, but nealy impossible when trying to do the same thing for sites created using the "WCF Service" Web Site project template.