tags:

views:

46

answers:

3

Hi -I am new to SharePoint development and have a question.

I got that SharePoint development could be 1. artifact-based and 2. assembly-based. Also, artifact-based is done with Designer and supports remote connection to the production server.

But what about assembly-based development -done with Visual Studio? Do we need to "copy" the required files from the production server to development server? Or is there any "hack" to connect remotely to production server with Visual Studio?

Thank you for your help.

Bruno.

A: 

When developing with Visual Studio for Sharepoint you need to have SharePoint installed locally.

See http://www.sharepointdevwiki.com/display/public/Building+a+SharePoint+Development+Environment

unclepaul84
Not quite true - it makes some things easier but its not impossible to develop on a machine that doesn't have SharePoint installed locally.
Ryan
+1  A: 

There are two parts to this: deployment and debugging.

For deployment, the best practice is to create a Sharepoint Solution (WSP) file and deploy that using stsadm and Central Administration. This will ensure that all of the necessary resource files, DLLs, etc. are put in their proper places across a Sharepoint farm. With Sharepoint 2007 and Visual Studio 2008, packaging the WSP can be difficult, but tools like WSPBuilder and WSSVSE help to smooth the process. However, with Sharepoint 2010 and Visual Studio 2010, this process is greatly simplified.

For debugging, you can use the remote debugging tools that come with Visual Studio to debug a remote Sharepoint instance, just as you do any other remote web debugging. If your WSP solution put any DLLs in the GAC, you will probably need to put the corresponding PDB files in the GAC, too, otherwise your breakpoints will probably never be hit.

Tim
Tim Larson
+1  A: 

While it is possible to compile locally and debug remotely, it is not the easiest solution and just doesn't work if you use Visual Studio Sharepoint Extensions - they don't work unless you have Sharepoint installed locally.

To compile an assembly that references Sharepoint assemblies all you have to do is copy them to your local machine and reference them from your project. To debug remotely you have to install and configure Visual Studio Remote Debugger on your test server. To deploy the dlls to the test server you can just copy them to the \Windows\Assembly folder and run iisreset. Then, hit your Sharepoint home page and once the page appears, attach remotely to all w3wp.exe processes on the test machine.

Remote debugging can be tricky as many times you will not be able to connect to the test server at all. On the other hand, if your local machine is not strong enough to handle both Sharepoint and Visual Studio, this may be the only option that will preserve your sanity.

Panagiotis Kanavos
Thank you -that was really useful.
Bruno Ligutti