March 2009 - Posts

When a WSP gets stuck in "Deploying"
23 March 09 06:44 PM | Blogging about SharePoint: Posts
Body:

Recently, I was involved in deploying two solution packages I had created.  The farm administrator had just used the the Solution Management page in Central Admin to deploy the packages globally, and the status was "Deploying" but more than the usual amount of time went by and it was still listed as Deploying. 

To resolve this, we first ran stsadm -o execadmsvcjobs on the server running Central Admin.  No change.  We then ran stsadm -o execadmsvcjobs on each member of the farm that had OWS Timer (sptimerv3) on it (everything included Reporting Sevices Servers, but not the database servers used only on the back end).

At this point, one solution package completed, but the other still did not.  We restarted the  OWS Timer Service (sptimerv3) on each member in the farm (again, everything that had OWS Timer on it).  At that point, both packages completed their deployment and all was well.

--Michael

Category: SharePoint – WSS and MOSS
Published: 3/23/2009 3:44 PM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Build Scripts for a SharePoint Solution
20 March 09 06:53 PM | Blogging about SharePoint: Posts
Body:

I thought it would be instructive to describe how I build and deploy a SharePoint solution that I have built in Visual Studio 2008.  I put this process together before I was aware of WSPBuilder, and probably before WSPBuilder was as popular and mature as it is now.  That means that I created my solution manifest and my diamond directive file manually.  It also means that although I use the structure of the 12 hive in my solution, I don't do it in quite the same way that you would with WSPBuilder.  I also find that the out of the box VS2008 / VSeWSS 1.2 support for workflow development doesn't do solutions in the way I want. I set up my Visual Studio project to do the following on every build ( side note: additional build modes that have different behaviors are sometimes desired - perhaps I'll set that up for my next project).  As background, note that I am working in a virtual machine that has MOSS and Visual Studio installed locally.

 

The Post-Build script in Visual Studio 2008 for my project:

time /T
cd ..\..\deployment
call RollbackDeployment.bat http://%COMPUTERNAME%/pathToSiteCollection  <solutionName>
echo end of rollback
time /T
copy $(TargetPath) $(ProjectDir)WebSolutionPackage
echo start install
call Install.bat http://%COMPUTERNAME%/pathToSiteCollection <solutionName>

time /T

 

What does RollbackDeployment.bat do? It un-installs the previous build:

if "%1"=="" GOTO Problem
echo Retracting previous version of Solution
echo CWD is %CD%

rem URL to site collection is %1 and solution name is %2
call RetractSolutionPackage.cmd %1 %2
echo Deleting previous version of solution
call DeleteSolutionPackage.cmd %2

goto TheEnd
:Problem
@ECHO OFF
echo You must specify the url of the site collection.
:TheEnd

RetractSolutionPackage.cmd does this:

rem STSADM is in the path and so is PowerShell

rem If you are building a workflow, you may want to delete the workflow association before you deactivate its feature.

rem I use a bit of PowerShell that you can find at codeplex.com/psbb to do that.

powershell.exe -NoLogo -Command ".\DeleteAssocation.ps1"
stsadm -o deactivatefeature -name %2 -url %1 -force
rem Note that here I assume my feature name is almost the saem as the WSP filename.

stsadm -o retractsolution -name %2.wsp -immediate
stsadm -o execadmsvcjobs

DeleteSolutionPackage.cmd not surprisingly does this:

stsadm -o deletesolution -name %1.wsp

Now we are ready to install our new build.  Install.bat does this:


if "%1"=="" GOTO Problem
if "%2"=="" GOTO Problem
echo Building package
call CreateSolutionPackage.cmd %2
IF %ERRORLEVEL% NEQ 0 EXIT 1
copy "..\WebSolutionPackage\%2.wsp" "."

echo Installing Solution
call InstallSolutionPackage.cmd %2
echo Deploying Solution
call DeploySolutionPackage.cmd %1 %2 %3
rem If we need to restart the OWSTimer service (e.g. for workflows that have delay activities), we use the next two lines.

net stop sptimerv3
net start sptimerv3
echo Done!
rem pause
goto TheEnd
:Problem
@ECHO OFF
echo You must specify the url of the site collection and the package name.

:TheEnd

CreateSolutionPackages does this:

cd ..\WebSolutionPackage
if EXIST %1.wsp del %1.wsp

echo Building DDF file
echo CWD is %CD%
"C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\makecab" /f package.ddf
IF %ERRORLEVEL% NEQ 0 EXIT 1
del setup.inf
del setup.rpt
rem Next step is so I can easily open the wsp in Windows Explorer to see what's inside.

copy %1.wsp %1.cab
rem to open a Windows Explorer window where you can see the .wsp and the .cab, uncomment the next line.

rem start .
cd ..\Deployment

InstallSolutionPackage does this:

stsadm -o addsolution -filename %1.wsp
IF %ERRORLEVEL% NEQ 0 EXIT 1

DeploySolutionPackage does this:

stsadm -o deploysolution -name %2.wsp -immediate -allowgacdeployment
IF ERRORLEVEL 0 stsadm -o execadmsvcjobs
IF ERRORLEVEL 0 stsadm -o activatefeature -name %2 -url %1

rem Next line is only used for a workflow project.  It creates the workflow association
IF ERRORLEVEL 0 C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -NoLogo -Command ".\MakeAssociation.ps1"

So now you can see how I get my project to deploy on build.

Hope you find this helpful.

--Michael

Category: SharePoint Development
Published: 3/20/2009 3:53 PM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
I'll be speaking at MS Virtual Tech Days, April 1, 2009!
19 March 09 11:54 PM | Blogging about SharePoint: Posts
Body:

I'll be giving my "Information Architecture for a MOSS Intranet" and "Site Provisioning Solutions" presentations.

More info here: https://www.msfttechdays.com/public/home.aspx

--Michael

Published: 3/19/2009 8:54 PM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
My WSS 3.0 Blog site looks fine under IE8
19 March 09 11:51 PM | Blogging about SharePoint: Posts
Body:

I just installed IE 8 tonight on my laptop, and BlumenthalIT.net (a WSS 3.0 site) looks fine.

Michael

Category: WSS 3.0
Published: 3/19/2009 8:51 PM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Filed under:
SharePoint Intranet Success Strategies webcast now available on demand!
08 March 09 01:13 PM | Blogging about SharePoint: Posts
Body:

A few weeks ago, Anthony Handley (Magenic), Martin Muldoon (BA Insight), and I co-presented a webcast called SharePoint Intranet Success Strategies. This webcast is now available on demand at http://www.magenic.com/LinkClick.aspx?fileticket=OYnLD424d0I%3d&tabid=635&mid=2996.

Enjoy, and let me know what you think of it!

 

--Michael

Published: 3/8/2009 10:13 AM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
PSBB mentioned on SharePoint PodShow episode 13
02 March 09 07:11 PM | Blogging about SharePoint: Posts
Body:

If you haven't started listening to the SharePoint Pod Show, you should! It's at www.sharepointpodshow.com, and I've listened two a few episodes so far - in particular the interviews with Andrew Connell and Jeremy Thake (Episode 13).  Thake even mentions my PowerShell Building Blocks (PSBB's) for SharePoint at 40 minutes, 53s to 42 minutes 45 seconds.  PSBB is one of my CodePlex projects - you can find it at www.codeplex.com/PSBB .  He mentions one that displays the SharePoint version number.  I don't think that's actually in the PSBB collection - yet. I need to add a number of scripts to it, and work with Neil Iverson to include his.  I the mean time, here is how to get the SharePoint version number.

function global:Get-SPFarm{

   return [Microsoft.SharePoint.Administration.SPFarm]::Local

}

$farm = Get-SPFarm

$farm.BuildVersion

 

The result is:

Major  Minor  Build  Revision

-----  -----  -----  --------

12     0      0      6318

 

--- Michael

Category: PowerShell and SharePoint
Published: 3/2/2009 4:11 PM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
March CSPUG Meeting - Registration Now Open!
02 March 09 06:49 PM | Blogging about SharePoint: Posts
Body:

Joel Oleson (www.SharePointJoel.com) will be our featured speaker at the Chicago SharePoint User Group meeting March 12, 2009.  Register now, as he is a rockstar of the SharePoint world, and registration will fill up fast!  He'll be talking about Governance.  Go to www.cspug.org or directly to the registration page here.

 

--Michael

Category: Chicago SharePoint User Group
Published: 3/2/2009 3:49 PM
Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks