0
votes

I've created a WCF service in Sharepoint 2013 and it works great on our dev server. However, we now need to push it onto a production server and I can't seem to find any instructions on how to publish to another server.

I followed a tutorial very similar to this one:

http://www.robertseso.com/2013/05/adding-custom-wcf-services-to.html

In development, but it doesn't cover actual deployment. As per this (and other) tutorials, I deployed as a "farm" solution. If I go to "publish" in Visual Studio the option to "Pubish to SharePoint Site (Sandboxed solutions only)" is grayed out.

1

1 Answers

1
votes

After a lot of searching around, I was able to piece together an answer. So in case anybody else encounters the same problem:

In Visual Studio, when you go to "Build" and "Publish..." you can "Publish to File System" (the Publish to SharePoint Site being grayed out as noted in the question). What this does is produce a .wsp file that is you packaged install file you need.

Transfer this file to your target SharePoint server and then open SharePoint Management Shell (as administrator). A list of available cmdlets can be found here:

http://technet.microsoft.com/en-us/library/ff678226%28v=office.15%29.aspx

I used:

Add-SPSolution -LiteralPath c:\<path to wsp file>\myservice.wsp

This adds the solution to Sharepoint but doesn't install it. To install you need:

Install-SPSolution -Identity myservice.wsp -GACDeployment

Note, however, that this will give you an error if the Sharepoint Administrator service isn't running (so check in services.msc first)

This add the installation job to a timer to be run at some point. You can check the status with:

GetSPSolution 

Which will list all the solutions, or you can pass a name to if you want to only see the one you just installed. This will show you the "Deployed" status of the service. In my case, it was stuck of False and even after several minutes refused to do anything.

In my case, this problem was solved by going back into services and restarting both SharePoint Timer Service and SharePoint Adminstrator after which is magically showed deployed as True.