I have a WinForms application that accesses about 80 WCF services. These services are hosted on a web server.
Now I have to change this application to run 100% locally on a computer.
What is the easiest way to do this without having to install IIS on a local computer?
Thanks!
there are 4 hosting options for WCF services:
Self hosting
Windows Service
IIS
WAS (Windows process activation service)
It's been my experience that self hosting is easy enough to set up quickly, and flexible enough to change later.
Related
.NET 4.5/4.6, Visual Studio 2015, Windows Server 2016
I see here, and elsewhere, that to self host (e.g. in an exe, without using IIS) a REST service, I can do that no problem. We like this because it simplifies deployment to get IIS out of the picture.
I also have a large asp.net application.
The question: Can I move the big asp.net app into a self hosted WCF application also? (for the same reason, to move to xcopy deploy and get IIS out of the picture).
No you can not self host ASP.Net web application built using .Net framework, you can host it only using IIS server. Though if your application is built using .Net Core framework, you might be able to self host it.
I looked into Azure cloud solutions and came up with below question regarding developing web app locally.
It seems like, if you develop Cloud Service, you can run locally with Azure emulator, if you develop Azure Fabric Cluster, you can run your cluster locally.
However, if you develop Wep app (part of App service) and you want to debug your app locally, you can either connect remotely your debugger to running web app or run the web app on your local iis.
Issue is, debug on azure emulator or running on local cluster seems to illustrate running the app on cloud better than develop on your local iis.
Am i missing something, or the development experience on App service lacks the option to run locally on "cloud like" environment(excluding the option of remote debug)?
Thanks a lot!
There is no emulator for App Service because at its core it is just an IIS farm (the Windows App Service at least).
We run apps locally on IIS Express + SQL Server 2016 Developer edition, and that corresponds quite well. Of course if we wanted we could set up an IIS farm locally and use that, but I think that's unnecessary.
You can get a bit closer to actual environment if you use the App Service Linux offering, as there you will run everything on Docker containers. So you debug on local Docker and then run it in prod on Docker.
I would also recommend you to check out deployment slots on App Service, as a staging deployment slot can help you find problems that occur in the cloud environment before you swap it into production.
In my personal experience developing apps for App Service, problems in the production environment were not caused because the environment was very different, but because we overlooked something with the database, made a mistake in a Web.config transform etc.
I have no prior experience working in the .NET stack. Not sure if this is a common requirement. I have developed a simple .NET web service which accesses the COM library provided by a label printer SDK to send print jobs to the printer connected to my machine.
I need to distribute the web service to clients so that it can be hosted on their machines locally. Set up should be minimum - something like an installer which will do the needful to deploy the web service locally.
I assume that any windows machine comes with .NET bundled.
I understand that IIS is the windows equivalent of apache-tomcat. Does is it come bundled with all windows machines? If it does, I figure I can write some scripts to deploy the web service to IIS using the ".deploy" file generated by Visual Studio.
Are there any betters way of doing this ?
So my question is :
How do I distribute a web service that should be be hosted and run locally on the client's machine without forcing the user to download and install a web server and deploy the package?
Edit:
So, I gather IIS is not supported by home editions.
I have ready project in silverlight, which is using wcf services.
I have one project for silverlight app and another for wcf services.
Can I move this wcf services from project to azure simple?
Or I have to rebuild all project.
There are 2 options.
Host your project as an IIS project on a Windows Server Virtual machine in Azure. No coding would be necessary, but you'd have to move your project to IIS.
Recode your Project as an Azure Cloud Service. It's not that difficult. I show an example of how to do that with an ASMX service in the below video, but moving a WCF service should be much easier than even this was.
Video is at:
http://www.youtube.com/watch?v=oQbMnoG56lk
I have some questions on deploying wcf web services on IIS 7:
I don't configure any endpoint or service in my *.cfg file, i enable only metadata and includeExceptionInFaults, but services are working properly on local server, when i debug application local IIS server some choose the port, endpoints. The questions is: will work web services without concrete configuration of endpoints / services, and this approach is good?
How to deploy application on a remote IIS 7 server?
Yes. Without a endpoint configured, a WCF service is self sufficient to work. It will by default use basicHttpBinding and the address based on where you place in IIS.
Refer to Default end point of WCF service for more detail.
For hosting in IIS, you can find a detailed walkthough in How to: Host a WCF Service in IIS