Can I host a wcf 4.0 website in IIS instead of as an application in IIS? - wcf

Most examples I see about hosting WCF in IIS have you create an Application under an existing website. I have a website in IIS, but the website uses a .NET 2.0 app pool, so I can't host the service as an application under the website. Is it better to create an empty website to just host the service or to create an empty website and then create an application under that empty website to host the service?

I have WCF running as a WebSite in both IIS6 and IIS7, and they work fine. They basically work exactly the same as any ASP.NET site; the .svc files are conceptually similar to .aspx pages, in that IIS calls over to .NET to process them, and all the core WCF stuff is in the assemblies in \bin. The web site is assigned to an App Pool where the actual processes run, just like a normal ASP.NET site. I don't think you need to make an 'Application' in IIS.

You don't need a new website - you can still host WCF in a 2.0 application pool - but in your project you'll need to set the target framework version to 3.5, instead of 4.0.

Related

Can I run .Net 4.6 Application under .Net Core Site on IIS

I inherited a project that is a collection of WCF Services that target .Net Framework 4.6.1. I wrote a front end SPA application that targets .Net Core 2.2 not realizing that the hosting model was such that both the UI (.Net Core) and the API (.Net 4.6.1) need to run under one Site on IIS.
I'm trying to get this to work on my local machine. I created a new Site in IIS -- Site A. I published my .Net Core application to Site A and set it up with an application pool set to "No Manged Code".
I then added an Application to Site A called API and added all my WCF services in that folder. I configured API to use an application pool that targets ".NET CLR 4.0".
I updated the web.config in the root of Site A to include all the necessary bits for WCF.
I'm able to hit Site A and get my SPA UI, but when I do anything that attempts to hit the backend API (including trying to hit it directly -- http://localhost:464646/api/test.svc), I get the following error:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
Is what I'm doing even possible? If so, what changes do I need to make in order to get this to work?

WebHost.CreateDefaultBuilder when hosting without IIS on Windows

I'm planning to host Asp.Net Core 2 application without IIS on Windows.
The default way to create web host seems to be using WebHost.CreateDefaultBuilder. But what is confusing me is that inside there is a call to the method UseIISIntegration.
Is it ok to use WebHost.CreateDefaultBuilder when hosting Asp.Net Core 2 app without IIS on Windows? Or other options are advisable?
Its absolutely fine to use WebHost.CreateDefaultBuilder
As when hosting with IIS it just work as proxy and redirect request to kestrel server.
It doesn't create much of problem.
Take a look at this article here

Hosting of ajax enabled wcf service in IIS 7

I have deployed an asp.net mvc application in IIS, The application has been deployed successfully and working fine. I Used ajax enabled wcf service in my application, the problem is when I want to use the method of the service. I get the not found error, but when I browse to see the service it gives the page saying that your service is hosted, I cannot access the methods of the deployed ajax enabled service.. Kindly help me out..
Things to be noticed..
My services are hosted as a file with the extension of .svc
I deployed the application on windows server 2008 r2 64 bit, but I configured the application pool to work in 32 bit.
Services are accessible, but the methods of service are not allowed.
Thanks in advance.
Ahsan Nomani.

Host to host multiple WCF services in same website in IIS 7.5?

How would I host 2 WCF services within the same web site ( i.e. same web application) ? I do not want to have each WCF with its own independent web site host.
WCF Services integration with IIS uses a .svc file for hosting in a web application.
You can create as many .svc files as services you created with WCF in the same web application, so you only need to create a .svc file for each WCF service inside your web project.
Maybe you could explain the implementation details services to know if this applies to you.

Optimizing wcf service in IIS

I am hosting a ASP.NET web site containing a wcf web service in IIS 7. The web service is exposed using a .svc file that resides inside the web site's virtual directory.
There's section is this document about optimizing the web service performance by removing unnecessary http modules:
http://msdn.microsoft.com/en-us/library/ee377061(v=bts.10).aspx
My question is how can I do that in the web config without affecting the web site? My ASP.NET web site contains authentication stuff and definitely requires some of those modules (eg, FormsAuthentication). Is there a way to enable those modules only for the web site but disable them when the clients access the web service?
Thanks
You should separete your project into two (web and Service).
After that, create a website into IIS and add those two application separatedly, like that:
That way you can handle different configurations for each site, and configure the modules for a especific "project" (like wcf service).