Home > General, SharePoint > Create SharePoint Project without install SharePoint Server

Create SharePoint Project without install SharePoint Server

SharePoint2010.reg
MyAssemblies

If you create SharePoint Project on VS2010, you may be prompted an error.

A SharePoint server is not installed on this computer. A SharePoint server must be installed to work with SharePoint Projects

Generally, Microsoft suggested to install sharepoint server on every development machine.

Having SharePoint installed is required.  It won't let you create a new project unless its present.  I remote debug a lot when MOSS 2007, but with all of the benefits in Visual Studio 2010, it is worth developing directly on the SharePoint server.


But there is some workarround to compile SharePoint project without installing SharePoint server.

Just confirmed .. was able to attach to the remote debugger on the SP2010 virtual machine from a host running VS2010.  If your interested in developing locally and remote debugging read on, otherwise follow Corey's advice :)  Once the plumbing is set up, it's pretty easy to remote debug.

I'm using VS2010 RC1 and SP2010 Beta.

Here are the steps to remotely build sharepoint components and remotely debug:


Create, build, and deploy your code

  1. Build a SP2010 virtual machine
  2. Install VS2010 on the host machine
  3. Export the hive [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0] (see attached registry file) from the virtual machine and install on the local machine
  4. Create a webpart project in VS2010, build, and package.
  5. Copy the wsp to the virtual machine and the pdb.
  6. Deploy the wsp via Add-SPSolution.
  7. Go to Run … enter c:\windows\assembly\gac_msil, find your assembly, copy the pdb to the same folder as the assembly.


Get the debugger running on the virtual machine

  1. Copy Remote Debugger to SP2010 virtual machine .. found on host at:  C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger
  2. Create identical debug user accounts on both the host and guest machines and add to local administrator group on both machines (not sure if admin group is necessary).
  3. On the virtual machine, start the msvsmon.exe, in the x64 folder using this command:             C:\Windows\System32\runas.exe /user:<your debug user account> /netonly "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe"
  4. On the virtual machine msvsmon, enter the password of the debug user account.
  5. On the virtual machine msvsmon, go to Tools->Permissions, and grant the debug user account permission to debug.

Attach to the process on the virtual machine from VS2010

  1. Refresh the page your webpart resides on to get the w3wp process going.
  2. On the virtual machine determine the process id of the w3wp instance your code is executing.  Not sure if IISApp.vbs is on Server 2008 R2, but this link provides a PS script to get the process id.
  3. On the virtual machine, make a note of the name of the msvsmon instance … mine is CORP\administrator@<server name>.
  4. In VS2010, Attach to Process, and enter the name of the msvsmon instance in the Qualifier field of the window.  
  5. Look for the instances of w3wp, and attach to the process id your code is executing in.
  6. Now the obvious step … set a breakpoint in your code, then refresh your page.

Note:  4 & 5 are where most of the issues, if you have any, will take place.  If you are unable to see a list of processes running, or even attach to the remote debugger, something is wrong with your debug accounts.  Note the id and pwd must be identical on both the host and guest.  I have them both in the admin group.  Also, be sure your running the x64 debugger.

Happy remote debugging.


Reference: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/cda807f6-4edf-4efc-8e9b-4d446356c8ae

 

Without installing SharePoint Server, you can still reference the SharePoint DLLs by setting assemblies references folder in registry. (http://msdn.microsoft.com/en-us/library/wkze6zky(VS.80).aspx)

DLLs ~\USER-TEMP\KP\SharePoint2010 DLLs.rar or download here
Extract the files to C:\SharePoint2010 DLLs and import MyAssemblies.reg (attached)

Categories: General, SharePoint Tags:
  1. No comments yet.
  1. May 30th, 2014 at 12:29 | #1
  2. June 6th, 2014 at 17:30 | #2
  3. July 5th, 2014 at 04:21 | #3
  4. August 17th, 2014 at 18:02 | #4
  5. August 17th, 2014 at 20:00 | #5
  6. August 20th, 2014 at 18:10 | #6
  7. September 10th, 2014 at 21:29 | #7
  8. September 14th, 2014 at 23:50 | #8
You must be logged in to post a comment.