I have developed a Web service using WCF Service Application. This service application is a part of multiple projects. we have data access , services(business logic) , testing(to test class) and WCF Service application.Where WCF Service application is just like an infterface and all the request are sent to the services project. so all the projects communicate with each other. I am new to hosting WCF application. Now to host this on IIS do i have to put the whole project in the IIS virtual directory?
Right-click the WCF Service project in Visual Studio and choose Publish.
You can manually copy the needed files or setup a script or other automated process to do it for you. Perhaps a Visual Studio post build event. I create my WCF services in their own website project under my solution. Then when it is time to deploy/update the production site, I copy the *.svc file(s) and the *.dll file(s) in the bin directory to the production folders. I keep a seperated web.config for my production and development environments.
Related
When we publish our ASP.NET Core application and upload to the server, we get an error:
The process cannot access the file because it is being used by another process.
And when stop iis not error. How to upload without stopping IIS?
If you use web deploy to push to an IIS you own (a machine located in your datacenter) you can try to recycle the AppPool used by the web application you are trying to redeploy.
Go to your IIS Management Console
Right click the AppPool in question
Choose the recycle option
Be aware that this would also 'restart' all other apps which are associated to this AppPool.
This 'should' work in most cases.
If you deploy to Azure you might consider using either a Linux App Service or some Docker deployment mechanism altogether. You cannot use the In-Process IIS ASP.NET Core modules in these cases as far as I am aware of but at least deployments don't randomly fail.
Am planning to build a WCF Web service using Visual Studio 2015. I came up with a sample web service that i can launch from visual studio and this works fine when i call the APIs from browser on local host.
Now i want to deploy it in a server. Am not sure how I can deploy in a server. The final out put of the web service is a DLL.
Can someone explain to me how to deploy this in a Windows server?
Do i need to run this web service DLL as a service?
Does it got anything to do with IIS?
As per your request, I have made this an answer.
If you're looking to host a WCF service which is exposed to the outside world then the best solution is to host the service via IIS which you can find out how to do by reviewing the following article.
You can find a more visual tutorial here.
If you encounter errors after publishing to IIS then please refer to the following StackOverflow answer to see which Windows Features must be enabled.
I would like to achieve, with Web API, the following WCF behaviour:
Using Visual Studio 2015 create a brand new WCF Service Application. Build. Right away the sample service is "online" and can be accessed with a browser, Fiddler, etc. I do not need to explicitly run the project in VS for the services to be available to any client.
I'm completely new to Web API, and have not seen any documentation on how to achieve this same seamless deployment.
Anyone?
Instead of running the project in Visual Studio (which spins up an IIS Express instance), make sure the IIS feature is turned on on your windows installation, and setup a new site, and point it at the directory of your build output.
For a step-by-step see: http://www.c-sharpcorner.com/UploadFile/2b481f/how-to-host-Asp-Net-web-api-on-iis-server/
I have developed a WCF service using .NET 3.5, VS 2010 on Win 7 64. This will be hosted in a Windows Service.
I created a Windows Service project to which an Installer is added by rt-clicking. The WCF dll is also added.
For testing purpose I have installed this service by running the InstallUtill.exe passing in the service exe from the Windows Service project release folder. All works fine I can see the service in Services.msc and they can be accessed by clients.
The client does not want an MSI so I have to give him the release folder of the Windows Service project.
Here are my questions:
Is it required to add the .NET framework requirement, which gets added by default for MSI projeccts, to the Windows Service project. If yes then how do I go about doing it?
Can the client use the InstallUtil.exe from the framework or is there another way to install on machines that don't have VS?
Does the service need to be built for both 32 and 64 bit systems?
I know that InstallUtil.exe is part of the framework and any machine that has one is good to go but just out of curiosity is there any other way to install the Windows service without an MSI?
Regards.
I don't know about InstallUtil.exe, but I do know that in order to install a WCF service manually, you need to:
Give the client the requirements (.NET framework, WCF installed)
Create a folder in IIS for the service
Create a bin folder in that folder
Copy the .svc and the web.config in the first folder, and copy the .dll in the bin folder
In IIS, right-click on the folders and Convert to application (the two folders)
Be sure that the folders have the appropriate rights
I had to do this for test purposes on several machines at my job. But in the end, we did an MSI for the client.
Hope that helps you!
I have 2 virtual directory on my IIS (first for server developing and second for client devloping).
Each directory point to different folders:
c:\Server\ -> localhost/Server/service.svc
c:\Client\ -> localhost/Client/service.svc
(Whenever server "binaries" are stable I copy them to Client path)
My problem is that whenever I start debugger for server (where in VS I set "Use local IIS web server" to "localhost/Server/service.svc" ) the breakpoints are also hit form localhost/Client/service.svc (also when "binaries" are different).
I thing it is because debugger connect to w3wp.exe .
I tried to change AssemblyInfo.cs but that didn't help.
Thanks.
I assume that run both websites under the same IIS AppPool. This means that both websites run in the same process. You need to use different IIS AppPools if you want Visual Studio to debug only Server.
Also you probably have architectural issue. Usually there is no need to have the same service.svc in client and server.
Normaly you should have one Visual Studio solution with 3 projects configured as follows:
Project with Contracts (contains data and service contracts)
Server project with *.svc files
Client project that contains Server references generated for Server endpoint.
Both Client and Server reference Contracts.