I recently read Simon's post about using Reflector with SharePoint. Inspired, I set about to use Reflector as a sort of "MSDN 2" to help me work through holes in MSDN's (and to be fair, the rest of the world's) documentation. Unfortunately for me, I had to track down DLLs and ASMX files from different subfolders of the 12 hive and even from the GAC.I'm writing this post to help me (and you) find the SharePoint 2007 DLLs and EXE's and everything else we might need to reverse eng…um, let me rephrase that, "embrace a lifestyle of self-service SharePoint documentation." That last bit sounds nicer, yes.For various non-technical reasons, I can't just post the code directly here—instead, we must each go to our MOSS (or WSS) farms and copy out the DLLs. Thus far I've found three directory trees SharePoint is storing its code:
#Freely distribute and use. Absolutely no warranty is implied. $dirTwelveHive = "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\" $dirMossServers = "C:\Program Files\Microsoft Office Servers" $subDirectory = read-host "Full pathname to write files?" mkdir $subDirectory -ErrorAction SilentlyContinue | out-null mkdir ([System.IO.Path]::Combine($subDirectory, "12-hive")) -ErrorAction SilentlyContinue | out-null mkdir ([System.IO.Path]::Combine($subDirectory, "MOSS")) -ErrorAction SilentlyContinue | out-null mkdir ([System.IO.Path]::Combine($subDirectory, "GAC")) -ErrorAction SilentlyContinue | out-null echo "Calculating time required to perform this operation…" $excludedFileExtensions = dir -path "$([System.IO.Path]::Combine($dirTwelveHive, ""template\images"")) " | foreach { $_.Extension.ToUpper() } | group | foreach { $_.Name } $excludedFileExtensions += ("MDF","LDF") $exclusionCriteria = $excludedFileExtensions | foreach { "*$_"} $allFiles = dir -path $dirTwelveHive -recurse -exclude $exclusionCriteria -ErrorAction SilentlyContinue $allFiles += dir -path $dirMossServers -recurse -exclude $exclusionCriteria -ErrorAction SilentlyContinue $allFiles += dir -path ([System.IO.Path]::Combine($subDirectory, "GAC")) -recurse -include "*SharePoint*.dll" -ErrorAction SilentlyContinue $allFiles | Select Extension | group Extension | select Name, Count | sort Count -desc | select -first 10 $sum = 0 $allFiles | foreach { $sum += (dir $_).Length } echo "`n`n Total size in MB: $($sum/1MB)" cp -recurse -force -path $dirTwelveHive -destination ([System.IO.Path]::Combine($subDirectory, "12-hive")) -exclude $exclusionCriteria cp -recurse -force -path $dirMossServers -destination ([System.IO.Path]::Combine($subDirectory, "MOSS")) -exclude $exclusionCriteria #does not preserve directory structure $filesFromGac = dir -recurse -path "$([System.IO.Path]::Combine($env:WINDIR,""assembly""))" -include "*SharePoint*.dll" $filesFromGac | foreach { cp -force -path $_ -destination ([System.IO.Path]::Combine($subDirectory, "GAC")) }
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u
Powered by: newtelligence dasBlog 2.2.8279.16125
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Peter Seale
E-mail