locked
Deploy an Event Receiver in Production Environment RRS feed

  • Question

  • I developed a ListItem Event receiver in my SharePoint Development environment and its working perfectly fine. But what is the process to deploy the same event receiver to the Production environment? I dont want to again install the VS 2010 on production server. What is the best way to do this?

    Thanks in advance.

    Wednesday, March 9, 2011 10:54 PM

Answers

  • Aparna,

    you can use something like this to log

    StackFrame stackFrame = new StackFrame();
                    MethodBase methodBase = stackFrame.GetMethod();
                    PortalLog.LogString("Exception – {0} – {1} – {2} - {3}", "Event Handler <your Event handler name>", exception.Message, exception.StackTrace, methodBase.Name);

    I completely agree with Phill you are supposed to deploy the solution to prod only if QA is passed and you are sure that it will work fine.

    You might also consider this tool:

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/07127aca-af96-4ae9-a5f6-3ba58440a0f1

    look ate Isahi's comments

    Pradeep


    • Marked as answer by Lily Wu Saturday, March 19, 2011 1:43 AM
    Wednesday, March 16, 2011 3:20 PM
  • Hi AparnaT

    You should never need to debug on your Production server, you should develop on your Development Server, then if that's OK move to your Staging environment and then onto your Production. If something is not working then you should pick up any exceptions and errors from the logs\custom logging and start again from the Development environment.

    I know not everybody has the luxury of each environment but it is the best way to go.

    Regards

    Phill


    If you found this post helpful, please mark it so. Thanks!

    Lightning Tools – where I work
    BCS Tester Man – My Codeplex personal project

    • Marked as answer by Lily Wu Saturday, March 19, 2011 1:43 AM
    Wednesday, March 16, 2011 2:27 PM

All replies

  • VS2010 generates a sharepoint solution (.wsp) file that you can use for deploying on production. To generate a new solution right click on your project in visual studio and select Package. Copy the generated WSP to your server and add it to the solution store either via stsadm or powershell. You can then deploy either from command line or central admin.

     

    stsadm -o addsolution -filename C:\Path\to\my.wsp

    stsadm -o deploysolution -name my.wsp -allowgacdeployment -immediate...


    SharePoint 2010 Extensions - http://sp2010ext.codeplex.com/ My Blog - http://www.withinsharepoint.com Twitter - http://twitter.com/#!/withnsharepoint
    Wednesday, March 9, 2011 11:08 PM
  • Thanks for the response MaartenSundman.

    Is there any way to debug the code after deploying on the production server itself or do we need to make sure that it exceutes well on the testing environment before it gets deployed?

     

    Tuesday, March 15, 2011 8:11 PM
  • Without Visual Studio installed, or similar development tools, you will not be able to debug the code.  I suggest integrating ULS logging into your code so you can simply view the production logs to see if it's behaving as normal.

    http://msdn.microsoft.com/en-us/library/gg512103.aspx


    http://donahoo-development.com
    Wednesday, March 16, 2011 2:06 PM
  • Hi AparnaT

    You should never need to debug on your Production server, you should develop on your Development Server, then if that's OK move to your Staging environment and then onto your Production. If something is not working then you should pick up any exceptions and errors from the logs\custom logging and start again from the Development environment.

    I know not everybody has the luxury of each environment but it is the best way to go.

    Regards

    Phill


    If you found this post helpful, please mark it so. Thanks!

    Lightning Tools – where I work
    BCS Tester Man – My Codeplex personal project

    • Marked as answer by Lily Wu Saturday, March 19, 2011 1:43 AM
    Wednesday, March 16, 2011 2:27 PM
  • Aparna,

    you can use something like this to log

    StackFrame stackFrame = new StackFrame();
                    MethodBase methodBase = stackFrame.GetMethod();
                    PortalLog.LogString("Exception – {0} – {1} – {2} - {3}", "Event Handler <your Event handler name>", exception.Message, exception.StackTrace, methodBase.Name);

    I completely agree with Phill you are supposed to deploy the solution to prod only if QA is passed and you are sure that it will work fine.

    You might also consider this tool:

    http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment/thread/07127aca-af96-4ae9-a5f6-3ba58440a0f1

    look ate Isahi's comments

    Pradeep


    • Marked as answer by Lily Wu Saturday, March 19, 2011 1:43 AM
    Wednesday, March 16, 2011 3:20 PM
  • Agreed, have a solid testing environment and test procedure completed before moving code in to production. It's just good practice and saves yourself from many headaches.
    My CodePlex - My Blog - My Twitter
    Wednesday, March 16, 2011 8:27 PM
  • okay.What abt using the Visual studio remote debugger?

     

    Monday, June 6, 2011 3:23 PM