When I publish a WCF rest service in IIS the services do not work? - wcf

Im using WCF REST 4.0 meaning to say their is no .svc file.. So I have 3 different service classes in one service WCF Rest Application project. And I registered all these services in the Global.asax
What im trying to do is that I have a set of Business Functions from a lower framework e.g: .NET 1.0/2.0 where in i use datasets and not call basic add/update/delete entity function unlike in the newer releases. So I wanted to ask if this type of match would work in .Net 4.0 or is their any other reason for this?
Thank you

If your services work in Web Development server than they have to work in IIS. What version of IIS do you use? Remember that extensionless URLs are only supported in IIS 7.x. If you want to use them in older version you have to modify IIS configuration (check this thread). Also make sure that your IIS has properly registred .NET 4.0 and all realted ISAPI. If you installed .NET 4.0 after IIS it is best to use aspnet_regiis.exe from .NET 4.0 folder.

Related

.NET Core Hosting Bundle

As far as I understood the Docs, the .NET Core Hosting Bundle installs the .NET Core Runtime, .NET Core Library and the ASP.NET Core Module.
It seems that there's a Bundle for every version of the .NET Core Runtime (2.0.6, 2.0.7, ...).
If I have a self contained deployment of my app, I still need the ASP.NET Core Module. However I don't see that the Module can be downloaded separately without the full bundle. Is there a place where I can download it ?
If not:
What's the point of having a self contained application, if I still need to install the whole .net core sdk/runtime bundle on my IIS Server?
There is no official download of the ASP.NET Core Module for IIS ("ANCM"), though it can be installed by calling the hosting bundle installer with OPT_INSTALL_LTS_REDIST=0 OPT_INSTALL_FTS_REDIST=0 as arguments (at least for 1.0-2.0 installs).
What's the point of having a self contained application, if I still
need to install the whole .net core sdk/runtime bundle on my IIS
Server?
Apart from the installer being able to install only ANCM, do not forget that IIS is not the only hosting option for ASP.NET Core Applications. People may still opt to host it on linux or as a Windows Service. Either being exposed to the public Internet (which is supported from 2.0+) or behind NGINX/Apache/…
It is also very useful to deploy preview, daily or custom builds of any component inside .NET Core / ASP.NET Core if needed.
Check the docs on this topic.
The ASP.NET Core Module is a fork of HttpPlatformHandler which was modified to work with ASP.NET Core's new system and was previously used to host ASP.NET Applications. related GitHub issue
IIS needs it in order to start up your ASP.NET Core application when the first request arrives and to route requests to the ASP.NET Core application.
With .NET Core (and hence ASP.NET Core), ASP.NET Core comes with its own http server (previously this was only possible with Http.sys aka WebListener self-hosting, i.e. commonly used for WCF services). It also redirects a couple of headers to the application, since IIS with ASP.NET Core only acts as reverse proxy.
In other words, ASP.NET Core is hosted outside the IIS process, and ASP.NET Core Module is there to communicate with it and starts the outside process if not already. This also means, that ASP.NET Core applications hosted in IIS are subject to IIS lifetime cycle (i.e. IIS may and will stop your applications when idle - This doesn't happen when you self-host your application or use something like nginx as reverse proxy).
With ASP.NET Core 2.1 preview1 it will also be possible to host ASP.NET Core application in the IIS process (w3wp.exe) for a improve request throughput. For more information on this, read ASP.NET Core 2.1.0-preview1: Improvements to IIS hosting

Why publishing to IIS is change for ASP.net core ?

When I publish under Visual Studio 2015 CTP 5 then I don't have to do setting for application pool CLR version.
Now for ASP.net core application and as per documentation (http://docs.asp.net/en/latest/publishing/iis.html) we have to do setting for application pool clr to No managed code.
Why it is like that ?
ASP.NET Core applications no longer run inside IIS but run out-of-process and IIS acts only as a reverse proxy. This functionality is provided by the AspNetCoreModule which is a native IIS module. Since no managed code runs in the IIS process it is recommended to set application pool as "No managed code".
I wrote a detailed blog post describing how ASP.NET Core applications are running with IIS. You can find it here.
This is because ASP.NET Core runs as a plain old command line application outside of the IIS. Therefore, IIS is merely a pass-through to Kestrel, which is the ASP.NET Core web server which runs in it's own separate process. This platform is what provides the cross-platform capabilities of .NET Core.

Can ASP.NET vNext with .NET core be hosted outside of IIS?

For Mono, it is explicit that ASP.NET can be hosted outside IIS on Apache or Nginx
Since the 1.0.0 release is nearby, I was looking at the publishing aspects of open source ASP.NET vNext.
Can ASP.NET vNext be hosted outside of IIS on a *nix server such as Ubuntu?
Yes, ASP.NET Core can be hosted at linux.
Have you tried this documentation, in which helps to install in Ubuntu 14.04?
AspNet Core has its own web server called Kestrel. Anytime you run an Asp.Net Core web app you run it using this server. IIS or Nginx are used as reverse proxies you can use when you want to expose your app in the wild (they can handle authentication etc.). During development you can just Kestrel directly without have to set up IIS or Nginx.
I dont know if it is working with Nginx, but Apache Server has a module called mod_asp which is a bridging component to the .NET runtime. Maybe that one is worth a try.

How to Use the WCF Service developed in .Net 4.0 in the Application developed in 2.0 or lower version?

I came across with this situation. I have one already developed Application in 2.0, Now in this application i want to use one WCF Service that is developed in 4.0. How can i do this?
I tried the following
1. Regular Method Add the Service Reference and then use that. It didn't work for me.
2. I googled it and i got one more method, using svcutil.exe, but i dont have svcutil.exe with 2.0.
Waiting for the response.
Thanks in advance.
Windows Communication Foundation (WCF) was first introduced to the .NET Framework as part of .NET 3.0. It's not available with .NET 2.0.
If the WCF service exposes a SOAP endpoint then you may be able to use it through the Web Service Extensions (WSE) that were published for old versions of Visual Studio. See here: http://www.microsoft.com/download/en/details.aspx?id=10854 for details.
If you want to use a service written in .Net 4 with a .Net 2.0 project, you should be able to use basic http binding. That should allow it to interop with a client that knows nothing about WCF. It's similar to using an old school .asmx web service.

wcf - .net 3.5 client and .net 4.0 routing service

is it possible for a .net 3.5 application to communicate smoothly with .net 4.0 routing wcf service?
should i get in to any problems when trying to perform this operation?
can i work with the simple channel factory?
Depends what you mean by communicate.
The application will be able to call the service over WCF.
It will not be able to call the dll directly, the dll runs in an application pool and the application pool is tied to a specific version of the framework.