I am following someone's tutorial like the following


Here are the steps i need to follow

Create a Visual Studio Project for the web service

  1. Create Project: Create a new web service project from visual studio. A default web service will automatically be added in the project. Remove that one and add a new web service. [ DONE ]

  2. Use SPContext if Required: Add required methods in the web service. To use SharePoint classes add references to SharePoint Assembly. You can access the current SharePoint Context by accessing Microsoft.SharePoint.SPContext. [ DONE ]

This is what I can't do as I don't know how to do it. Please help.

  1. Place DLL in GAC: Once you are done with coding and the project is compiling ok then you need to place the dll of the project to GAC. Sign your assembly with strong name before deploying in GAC.

I would appreciate if someone could tell me what to do some instructions. i am using visual studio


1 Answer 1


You need to sign your assembly with a key to allow it to be deployed in the GAC.

With the project node selected in Solution Explorer, from the Project menu, click Properties (or right-click the project node in Solution Explorer, and click Properties). In the Project Designer, click the Signing tab. Select the Sign the assembly check box. Specify a new key file. In the Choose a strong name key file drop-down list, select . Note that new key files are always created in the .pfx format. The Create Strong Name Key Dialog Box appears. In the Create Strong Name Key dialog box, enter a name and password for the new key file, and then click OK.

Once it's done, rebuild your project and place the assembly in the GAC.

Open the Visual Studio command prompt, as follows: Click Start, point to All Programs, point to Microsoft Visual Studio 2010, point to Visual Studio Tools, and then click Visual Studio Command Prompt (2010). Type the following command:

gacutil.exe /if "<path to the assembly .dll file>"

This installs the assembly to the GAC, overwriting any existing assembly that has the same assembly name.

But I suggest you to create an empty SharePoint Project in visual studio 2010. This will create a project with a .SNK for signing, and will allow you to create a SharePoint package (.wsp) which is the standard for SharePoint deployment (you don't want to manually put stuff in the gac on production box don't you ?). You can add the extension CKS:DEV for Visual Studio 2010 to really help you in automate all this (and easily deploy to the gac by right clicking on the project and using the context menu)

  • Francois its my first project in SharePoint 2010 and we do have UAT and Production (two seperate environments) I am trying to write a custom webservice which talks to a 3rd party Oracle DB and send/receive data. also receive data from Oracle and write into SharePoint List..Also writing Visual webparts which will consume the same webservice. I am quite scared at this moment and want some easy movement of webservice update and visual webpart updates from UAT to Production and vise versa ..so keep this in mind how should I write custom webservice using empty sharepoint project to achieve all
    – user342944
    Mar 16, 2013 at 11:04
  • one more i am having difficulty with.if i select EmptySharePoint project it asks me the name of the site where it deploys the solution. If i will deploy on uat how will I move it on production then.
    – user342944
    Mar 16, 2013 at 11:14
  • name of the site means your internal "dev" server (or a target one), it has no impact to the final WSP. You'll have to create a SharePoint project in all case - knowing now your requirements - but it's still easy to start with an empty SP project (which will help you to create the WSP & send to gac for quick testing) then adding your visual webpart & web service(s). Mar 16, 2013 at 12:03
  • yeah internal "dev"..thanks..Francois any tutorial which i can follow step by step as per your suggestion.
    – user342944
    Mar 16, 2013 at 12:39
  • that's a huge topic, I'd rather pick any SharePoint Development book from Wrox, OReilly, APRess, ... to get you started. You could also check community projects like spsf.codeplex.com :) Mar 17, 2013 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.