Help - uanble to Debug Feature Receiver with VS2010 on SP2010 Farm

Answered Help - uanble to Debug Feature Receiver with VS2010 on SP2010 Farm

  • 20 Nopember 2010 12:44
     
     

    HI,

    I am unable to debug the feature receiver using VS2010. I Changed the Active Deployment Configuration from Default to No Activation. Set the breakpoint and press F5, I get the below error

     "Unable to start debugging on the web server. The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. "

     We are running VS2010 on x64 bit Windows2008 server and the farm has 1 App server, 1 WFE server and 1 sql server.

    I would really appreciate any help regarding this.

    Thanks! 

     

Semua Balasan

  • 20 Nopember 2010 15:14
     
     
    It sounds like you are trying to debug a remote server.  Can you confirm if you are debugging code on a local or remote server?
    My SharePoint Blog - http://www.davehunter.co.uk/blog
  • 20 Nopember 2010 16:37
     
     

    I am debugging on the Application server itself. I have Visual studio 2010 installed on it.

    Thanks.

     

  • 20 Nopember 2010 23:30
     
     

    You should debug on the web server. If you can access the web site from the application server it should be OK but be sure you point to the web site on the applciation server and not on the WFE.

    Can you try doing only a deploy (no F5 just deploy from the project right click menu). Then attach the debugger manually (make sure you attach to the right process, either w3wp or the sandbox process).


    Florin DUCA MCSE 2003 +Sec,MCTS conf/dev WSS3/MOSS, MCITP/MCPD SP 2010, MCPD ASP.Net 3.5, MCTS ISA 2006 Logica Business Consulting, France
  • 21 Nopember 2010 4:37
     
     
  • 21 Nopember 2010 6:42
     
     

    It is not possible to debug feature event receiver with the F5 debugging. To debug the feature, you can do the following:

    1) Choose No Activation for deployment configuration

    2) Press F5 to start debugging

    3) Go the SharePoint site, activate the feature

    4) You should hit the breakpoint

    If you have already done the above steps, then please check whether you are debugging from WFE.


    Regards,
    Chakkaradeep | SharePoint Server MVP | SharePoint Solutions Specialist | http://www.intergen.co.nz | http://twitter.com/chakkaradeep | http://www.chakkaradeep.com
  • 21 Nopember 2010 11:05
     
     Saran Jawaban

    Since you probably need to debug a feature running on the web front end and since Visual Studio  2010 is installed on your application server (hopefully not in production;-), you must set-up remote debuuging on the web front end as illustrated in msdn http://msdn.microsoft.com/en-us/library/bt727f1t.aspx

     

    -Launch the Remote Debugger x64 (MSVSMON.exe) on the remote SharePoint server. By default this is located in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64 (note: you need the x64 version). Copy this whole directory to the SharePoint server and launch msvsmon.exe

    -set your breakpoint in the feature activation event handler for instance

    -Then no F5, but just attached to the remote w3wp.exe from Visual studio

    -Activate your feature and you should hit your breakpoint.

     

     


    Serge Luca; MVP blog: http://sergeluca.spaces.live.com Devoteam Belgium. http://twitter.com/sergeluca
    • Disarankan sebagai Jawaban oleh daniel.larson 23 Nopember 2010 21:59
    •  
  • 23 Nopember 2010 4:21
     
     

    Thank you all for the response. I installed VS2010 on the WFE and tried to debug, still can't hit the break point. Here are the steps I followed.

    - Set deployment configuration to No Activation

    - Press F5 to debug - F5 does the redeployment and during the process retracts the solution as well. When I go to the Features managment page for the site, I don't find the feature. So I left the debugger running and deployed the solution from Central Administration. Once deployed I tried to "Activate" the feature but the breakpoint is not hit. I don't know how else to debug this solution. Please let me know if I am missing something.

    Thanks!

  • 23 Nopember 2010 5:54
     
     

    Ok, to make things clear - Visual Studio only supports stand alone installation of SharePoint 2010 - which means, you can deploy to a single standalone server - In your case, you are having a farm installation with App Server and Web Front End - So, trying to deploy from VS2010 in a WFE is not going to work. 

    You need to develop your solution (.wsp) in a development environment, test it properly, then package it, deploy to your production farm. Now, you need to perform remote debugging in order for you to debug as the assemblies are in production and VS2010 is in development environment. For more info on how to setup remote debugging, visit here - http://msdn.microsoft.com/en-us/library/bt727f1t.aspx


    Regards,
    Chakkaradeep | SharePoint Server MVP | SharePoint Solutions Specialist | http://www.intergen.co.nz | http://twitter.com/chakkaradeep | http://www.chakkaradeep.com
  • 23 Nopember 2010 5:56
     
     

    " I don't find the feature. So I left the debugger running and deployed the solution from Central Administration. " -> it means that your solution was not actually deployed on you WFE when you cicked F5.

    Try this:

     - deploy using the deploy the deploy contextual menu (or even the F5). 

    - open a page on you site (to warmup the SharePoint site) then go to feature management page

    - attach the VS debugger manually to the W3WP process

    - activate the feature from the browser (from the feature management page of the site)

     


    Florin DUCA - MCSE 2003 +Sec,MCTS conf/dev WSS3/MOSS, MCITP/MCPD SP 2010, MCPD ASP.Net 3.5, MCTS ISA 2006 - Logica Business Consulting, France
  • 23 Nopember 2010 15:39
     
     

    Chakkaradeep, Thank you for the information. Here's our situation. We are in the process of migrating to SP 2010 mid size farm (1 App server, 1 WFE, 1 SQL server) from MOSS small server farm (1 database server and 1 SP server). In this process we are looking to redesign one of the features. Since we decided to redesign before SP 2010 go live and the so called production is the only env available to me to redesign this feature what are my options. How do I go about the development on the SP 2010 farm? Please let me know.

    Thanks!

     

  • 23 Nopember 2010 19:01
     
     Jawab

    There are two ways to accomplish this:

    1) You can redesign the feature in MOSS 2007 and then perform the upgrade to SP2010. 

    2) Perform the upgrade to SP2010 and then redesign/redevelop the feature

    For both, you need to make sure you are working against the development environment, packaging the solution and deploying it to the production. Developing against Production is not a supported scenario.

    If you are looking for the 2nd option, you can very well install SP2010 on a Windows 7 Client and develop on that.


    Regards,
    Chakkaradeep | SharePoint Server MVP | SharePoint Solutions Specialist | http://www.intergen.co.nz | http://twitter.com/chakkaradeep | http://www.chakkaradeep.com
    • Ditandai sebagai Jawaban oleh Wayne Fan 02 Desember 2010 3:24
    •  
  • 14 April 2012 13:31
     
     

    Hi,

    This thread is old, but still relevant

    this is the msdn how to : Debug a feature receiver
    http://msdn.microsoft.com/en-us/library/ff798479.aspx

    If the breakpoint is ignored, you should have attached your debugger to the wrong process, use this to grab the good w3wpe process for farm solution

    >cd C:\Windows\System32\inetsrv
    >appcmd list wp
    >pause

    Regards

    Amine Hakouna
    .Net/JEE Solutions Architect