Archive pour le Tag 'EPM'

Developing for SharePoint and Project Server remotely? Yes please!

If you are like me, you don’t particularly enjoy having to work inside of a virtual machine in order to develop for SharePoint and EPM. Well, as it turns out you can do away with all of that!

Microsoft recommends developing inside a virtual machine because it simplifies many things and that is a decent solution for many people but in my case it was quite annoying for the following reasons:

  • My workstation is a laptop and as such, not quite as powerful as I would like my development environment to be.
  • Having to run a virtual machine with Windows Server 2003, MOSS, PS2k7, SQL Server and Visual Studio 2008 on top of the host OS is quite a huge overhead!
  • I constantly have to switch between my guest and host OS.
  • For the previous reasons and unless I had ungodly amounts of memory, disk swapping occurs and everything slows to a crawl.

So if you don’t mind having to execute a couple of tricks to unshackle yourself from this unpleasant situation, more power to you!

Here are the basic steps involved:

  1. Use this neat trick to copy SharePoint’s DLLs from the MOSS server’s GAC into your workstation’s GAC.
  2. When you need to deploy things to the server, use Sysinternals’ excellent psexec tool.
  3. (Optional) Copy the SharePoint XML Schemas from the MOSS server on your computer and get Intellisense working when you edit SharePoint XML files.

I have a “RemoteDeployment.bat” file with the following:
(You will want to adjust the bolded text to your own environment)

@SET SERVERNAME=VDEV-MOSS
@SET REMOTEPATH=C:\SolutionDeploy
@SET REMOTEPATHUNC=C$\SolutionDeploy
@SET PSEXEC=C:\Windows\psexec.exe \\%SERVERNAME% -s -w %REMOTEPATH%
@SET STSADM="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe"
@SET WSPFILE=MySolution.wsp

@REM Copy the solution files to the remote computer
xcopy %WSPFILE% \\%SERVNAME%\%REMOTEPATHUNC% /Y

@REM Run the relevant STSADM commands on the remote computer
%PSEXEC% %STSADM% -o upgradesolution -name %WSPFILE% -filename %WSPFILE% -immediate –allowgacdeployment
%PSEXEC% %STSADM% -o execadmsvcjobs


Note: this assumes you have admin rights to the target server; You could do “net use \\SERVERNAME\admin$” prior to running the above batch file.

Now you can develop for SharePoint in the comfort of your own workstation!

In my case, I have a virtual machine with Windows Server 2003 and MOSS, and another with Project Server running inside a VMWare ESX powerhouse and my workstation is running Visual Studio 2008 on top of Windows 7. I can debug remotely when I need to, everything now runs lightning fast and I couldn’t be happier!

Note: I did not elaborate much on the Project Server part of this as it involves basically the same steps. You need to copy Project Server’s GAC’d DLLs into your own workstation and reference them from your projects.

Finally

I hope this article was useful to you and I would gladly elaborate on some steps if needed.

Disclaimer: As usual for these sorts of things, your mileage may vary.

____________
Daniel Laberge

Consultant, developer.