Thursday, 28 February 2008

How To Determine Which Version of MOSS 2007 is Installed

Need to determine which version of WSS or MOSS has been installed on a server?

The easiest way to get the current version number is to browse to the Site Settings page (eg. for your Central Admin site): http://myserver:ca_port/_layouts/settings.aspx.

You can also hit the database:

SELECT [VersionId]
,[Version]
,[Id]
,[UserName]
,[TimeStamp]
,[FinalizeTimeStamp]
,[Mode]
,[ModeStack]
,[Updates]
,[Notes]
FROM [SharePoint_Config].[dbo].[Versions]
WHERE VersionId = '00000000-0000-0000-0000-000000000000'
ORDER BY Id DESC

The version numbers correlate with the more familiar release names listed below (note these version numbers differ from what you might see through the Add or Remove Programs applet or a DLL version):
  • MOSS Beta 2: 12.0.0.4017
  • MOSS Beta 2 TR: 12.0.0.4407
  • RTM: 12.0.0.4518
  • August 24 2007 Hotfix Package: 12.0.0.6036
  • SP1: 12.0.0.6219
These version numbers are supposedly the same for both WSS 3.0 and MOSS 2007 but I don't have a pure WSS environment to confirm that.

If your installation isn't running and you can't access the CA site, check out the following links to learn about alternative means to find the current version number.
 

Wednesday, 20 February 2008

Deploying SharePoint DLLs to the GAC

Deploying the DLLs in a SharePoint solution to the GAC is pretty straightforward.

Firstly, ensure the assembly is signed by opening the Signing tab on the project properties in Visual Studio. Create a new key file (no password) and make sure the Sign the assembly box is checked. If you do this, you don't need to go through the whole sn -K and AssemblyKeyFile attribute process--Visual Studio takes care of it all.

Next, open the solution manifest (the SharePoint solution, not the Visual Studio solution...) and change the value of the DeploymentTarget for the DLL to be GAC'd from WebApplication to
GlobalAssemblyCache.


Rebuild your CAB file and re-deploy specifying the -allowGacDeployment stsadm flag with the deploysolution operation. Browse to %windir%\assembly and your GAC'd assembly should be present. The local \bin directory won't contain the DLL in question.

What about debugging and symbol (pdb) files? Apparently they can remain in the \bin directory but I haven't had much joy with this myself. Instead, I map a drive to \\{machine_name}\c$\windows\assembly\gac_msil\{version_publickey} and copy .pdb files across either manually or using a deploy script (see my debugging tricks).

Wednesday, 13 February 2008

RAID Types

I can never remember what RAID numbers mean what so in the interest of clearing yet another sticky note from my desk, here's a simple reminder post.

RAID 0 - Striped (fast)
RAID 1 - Mirrored (redudant)
RAID 5 - Striped with parity
RAID 0+1 - Striped and mirrored
RAID 1+0 - Mirrored and striped

Wikipedia has a really good, in-depth article for more info.

Wednesday, 6 February 2008

Consulting/Contracting and Peter

So in case you haven't noticed the change to my profile I recently became a full-time contractor. In addition to working previously as an analyst programmer for Tourism Western Australia, I started consulting half a day per week to assist the Department of Education and Training with the migration of a number of sites to MOSS 2007. Last August I started looking to move on from Tourism to get out of government and the associated politicking, make private industry dollars, and extend myself a little bit (fortunately I was smart enough to turn down an offer from Commander). The consulting gig proved contracting isn't so bad so when a Developer Coordinator contract position was advertised back at Tourism I couldn't help but take the plunge.

Working as a consultant for DET is quite rewarding. SharePoint and MOSS actually behave in the DET environment. While they've gone down the customised branding path they've also stuck with OOB web parts so to date I haven't faced any really tricky problems; as the 'expert', I'm in a position I like to be in. Apart from that, a single developer has managed to put together three sites in a around three months so it's good feelings all around. http://www.westernaustralia.com/ and http://www.tourism.wa.gov.au/, by comparison, took nearly eight developers (on and off) and half the organisation a year or more to launch. That said, we were one of the first branded sites to roll out on the MOSS 2007 platform and we had many, many, many technical problems with an early MOSS beta.

I'm three weeks in to my contract at Tourism and I've been surprised at the differences not only between quasi-permanent employment and contracting but at the differences in conctracting for different agencies. I'm also reading The Peter Principle at the moment and trying to assess whether this Tourism "promotion" has allowed me to arrive at my level of incompetence!

Apart from the 40-hour week versus a 37.5-hour week and being conscious of the fact I'm no longer entitled to sick leave, public holidays, or anual leave, I'm also keenly aware I really need to earn my keep now--in other words, there's no room for incomptence. I was on a fixed-term public service contract (salary, holidays, sick leave, etc but with a finite contract term of two years) as an analyst programmer and was cheap to employ; as a contractor I earn a lot more money and cost my employer a lot more money. More importantly, my contract runs for a mere six months and in that time I have to prove my worth by working to a controlled work package to produce the expected output. Luckily I've been in a position to define the schedule for delivering that output.

At Tourism I work directly for the CIO and I'm tasked with fixing content deployment and some other big-ticket items. The Tourism CIO is an alright guy but he's reasonably new to the organisation and intent on running a far more controlled IT department than his predecessor. While I welcome the change, moving from the previous free-for-all situation to such a formalised, process-driven environment is a swing back in time for me as a former EDS employee. I know my abilities and know I will deliver what I'm asked to deliver (process or no process) so to have a really hands-on superior managing me so closely--at least initially--has felt overbearing at times. EDS was very formalised and process-driven but my managers trusted me and as a young go-getter I never felt the opportunity to become incompetent.

It's unfortunate that despite coming back to work for the same organisation I have to prove myself once again to the new CIO (our previous CIO left a year earlier). Realistically, I'm doing very different work in my new role so I'm happy proving myself to everyone, at least a little bit. I've also been paired with an architect mentor to assist me in making the transition. I'm comfortable with the mentoring arrangement and looking forward to learning as much as possible but I'm also confident in my own abilities, I know the software, and with such a shortage of developers in Perth I'm simply the best person for the job. I don't mean to sound arrogant but in reality I've been doing a lot of what's required of my current role for my entire career of four years.

At the moment this adds up to me questioning my abilities and desire to produce quality output. Sure, I need to win the new CIO's trust and to do that I have to deliver what's expected of me on time. I'm also finding I need to win my own trust and prove me to me.

All up, I'm enjoying consulting. Like most people (I assume), I'm happiest when I'm productive and at the moment I'm really pushing myself to be productive so I don't fall behind schedule. At the same time, I'm thriving on the added responsibility and despite being a developer type, I really love being outside my box and engaging with the team and the organisation. I've definitely found the lack of interaction with folks over the past two years a big downer.

Either way, it will certainly be interesting to see how I feel about all this in another six months!

Japanese Site Launched

The Japanese version of my favourite tourism web site www.westernaustralia.com launched on Monday. This is the second foreign language site rolled out by the team with no less than five more sites to come (simplified Chinese, traditional Chinese, Korean, Italian, and French). The German site launched before Christmas.

I was tasked with localising the existing site using the .NET resource system last year and rolling out new language sites are now a breeze from a technical standpoint. A preliminary posting on how this was accomplished with SharePoint is soon to be followed by a follow up piece examining another huge set of issues... stay tuned (or check out my posts tagged "Resources")!

Friday, 1 February 2008

How to identify your SQL Server version and edition

This article tells you how to determine the version and service pack level for a given SQL Server and, at the time of posting, includes everything from SQL Server 6.5 to 2005 SP2.

http://support.microsoft.com/default.aspx?scid=kb;en-us;q321185

Tuesday, 15 January 2008

Free MS Press eBooks: AJAX, LINQ, Silverlight

Microsoft Press has made the contents of three ebooks available for free (you must register to download the full ebook).

Get the Free Visual Studio 2008 e-Book Offer

"The offer includes the entire contents of Introducing Microsoft LINQ, as well as sample chapters on related technologies from Introducing Microsoft ASP.NET AJAX for Web Developers and Introducing Silverlight 1.0."

SharePoint Server 2007 SDK (SP1 Dec 07 Refresh)

The latest SharePoint Server 2007 SDK has been released and supposedly includes SP1 documentation:

http://msdn2.microsoft.com/en-us/library/ms550992.aspx

Oddly enough the link seems to be to the SDK from last August...

Wednesday, 9 January 2008

Google Apps Uncovered

I own the mediawhole.com domain and when I recently stumbled across the Blogger publishing option to host this blog using my own domain name, I thought COOL! Instead of michhes.blogspot.com, I can use blog.mediawhole.com. All I had to do before turning on this feature in Blogger was create a new CNAME record pointing blog.mediawhole.com to ghs.google.com. And that’s where the adventure began... While I’ve configured name servers for my web sites before, I’ve never had to deal with CNAME records or any other type of DNS record for that matter.

My domain name registrar (Planet Domain) allows me to assign name servers and create child domains pointing to an IP address—basically an A record. As I wasn’t using Planet Domain for hosting the mediawhole.com site that’s all they would allow me to do, aside from renew my domain and update my registration details. A query to their helpdesk suggested my web host would be the best place to create CNAME record.

I was previously using atspace.com to host mediawhole.com. atspace provides free web hosting with no ads, FTP access, and POP3 email. Apart from those goodies, they also limit the size of file uploads to something ridiculous like 200KB. At any rate, the atspace interface allowed me to create the blog.mediawhole.com sub domain (what that resulted in at the DNS level, I’m not quite sure—I never checked).

While reading up on DNS and CNAME records, I came across a help page from Google Apps; little did I know my web master world would soon change instantly. What on earth is Google Apps, I asked myself, and proceeded to do what I could to find out. In typical Google fashion, the Google Apps homepage is a little blah and at first glance I figured it was a paid for service (a paid for service from Google? Isn’t everything from Google free?!?). Digging deeper, I discovered there is a free version and the major differences between the free version and the paid for version is the support on offer and the rather large limits on what you get (users, storage capacity, etc).

I signed up to have a looksee and soon realised Google Apps integrates a basic content management system, email via Gmail, calendars, IM, a user management system, a document repository that works with Google’s online document editing suite, and a few other goodies. Most of these features are all beta software. Apart from that, Google Apps gives you the opportunity to create and manage your very own (albeit, web-based) enterprise. You can effectively brand Google to a limited degree so it looks at home on your intranet, create user accounts with corresponding email addresses, create email lists and email address aliases, share your calendars, publish a public web site, and manage documents. The fancier offerings even offer a single sign-on feature.

The best feature of all is the option to use your own domain name for all of these services for a unified, professional appearance. Forget the blog, I was going to move my entire Google Apps suite to mediawhole.com! Just like blogger, Google Apps allows you to create various CNAME and MX records pointing to ghs.google.com (in the case of the CNAME records); the individual apps are then assigned to those URLs.

Planet Domain and atspace, I realised, weren’t going to help much with this. Planet Domain was a basic starting point for my name servers but I really needed control over all the DNS records for my domain. Although Google provides all the Apps stuff, they don’t provide any form of DNS management. Many of the Blogger and Google Apps instructions feature Go Daddy so I thought transferring my domain name to Go Daddy might also give me a better control panel for this sort of thing. They were also offering a free year of registration on top the time remaining on my current registration for seven bucks so I thought it might be worth it.

While I waited for Go Daddy support to reply to my email query, I Googled free DNS to see what might be available. I was in luck as I discovered, everyDNS.net, among other free DNS hosts. The web sites for these free DNS providers are atrocious (I’m not joking—they’re all very 1996) so I have no idea how reliable they or how long they’ll be around. Many DNS providers claim to host many thousands of records and offer globally distributed redundant records so I pretty much took a punt on everyDNS.net.

To get up and running, I firstly had to set my name servers to point to the everyDNS.net name servers. I did this through Planet Domain and was surprised to see how quickly the update took hold. Instead of twenty four to forty eight hours, my name server configuration changes were available almost immediately—within half an hour max. That was great as it allowed me to create my CNAME and MX records through the everyDNS.net interface and test my changes in real-time (with the name servers configured, all of my other records are resolved through everyDNS.net so any subsequent additions or modifications are instantaneous because everyDNS.net doesn’t have a waiting period for record propagation). One by one, I walked through the Change URL wizard for each of the Google Apps, creating DNS records as instructed in the very decent Google Apps help section. The mediawhole.com site now looks like this:

http://www.mediawhole.com – the Google-hosted content management system for the site
http://mail.mediawhole.com – the Google-hosted email system for the site
http://calendar.mediawhole.com – the Google-hosted calendar system for the site
http://documents.mediawhole.com – the Google-hosted document repository for the site
http://intranet.mediawhole.com – the Google-hosted, Mediawhole-branded search page for the site
http://blog.mediawhole.com – this Blogspot blog

As I worked, I used a handful of tools from some DNS-oriented sites to verify my changes.
networktools.com - DNS lookup, ping, and other useful tools
hscripts.com - DNS lookup and other bits and bobs
MxToolbox.com - Specific MX record lookup

The ping and tracert commands in Windows also come in handy. At one point I thought I also needed to flush my local DNS cache, for which I used ipconfig /flushdns

With email configured, I also set up a few email accounts for the people involved in mediawhole.com and some generic email aliases (support, helpdesk, info, sales, and a catch-all) delivering mail to my account.

Finally, I jumped into the web page editor, chose a template for the site, and started plugging in some basic content. The editor allows you upload pictures and files, edit the HTML directly, and add gadgets. It’s generally fairly basic (I haven’t come across a way to reuse content—like a footer—between pages) but the templates and three layout options do the trick. Unfortunately Google Apps doesn’t allow you to connect via FTP but in this day and age that’s a minor niggle.
This is a great tool for individuals, small businesses, schools, and community groups that might otherwise struggle to maintain the hardware and software to support a suite of functionality this comprehensive. I had the mediawhole.com site up and running in an evening (around four hours before sitting down to put in any real content). It will be interesting to see what new apps are added to Google Apps over time; the basics are all there now but I’m sure those Google heads will keep pushing.

Incidentally, Microsoft Office Live has also been rolled out in the US. The online marketing material suggests it’s a very similar offering but I haven’t been able to test it out as the beta is only open to residents of the US. If there are any other similar suites out there, please let me know.

Thursday, 3 January 2008

C# Switch Fallthrough with goto

Everyone hates the thought of goto because it was so well abused back in the day. I've seen so many coding standards denying the use of the goto keyword due to the risk of introducing "spaghetti code". So let's make things very clear: I am not advocating the use of goto as a general control flow mechanism except in the very few cases where it's warranted. In other words, don't assume I'm a freak of nature simply because I've even mentioned goto in a positive light and it's not 1968.

As you're no doubt aware, C# is a modern programming language following in the tradition of C, C++, and JAVA. It's full of all the standard control flow operations like for, foreach, while, do...while, if, and switch and it also attempts to remove a number of trouble spots available with its ancestors (automatic fallthrough in switch statements, pointers, memory cleanup). So one must ask, then, why the language retains the lowly goto keyword! I've read examples of using goto in languages that don't support modern control flow constructs; in that context it makes perfect sense to overcome a deficiency of the programming language using the fundamentals provided. So how does it fit in today?

The behaviour of the switch statement in C# may not be what you're expecting if you're coming from a C background because case blocks don't "fall through" by excluding a break statement. Every C# case block must contain a break statement. This is a good thing because if you inadvertently forget a break statement in a language like C, the compiler may not warn you about the omission and case blocks will continue to execute until the switch statement ends or a break statement is reached. The end result: a defect--and potentially a very significant defect. In C# if you omit the break statement compilation will fail.

At first glance this sounds like the C# language doesn't allow fallthrough in a switch statement but that's only partly true: C# doesn't allow automatic fallthrough in a switch statement. If your design requires a case block fall through you can enable this behaviour explicitly using a goto statement. If you control yourself and don't run out and replace all of your existing control flow statements with gotos, you can even use a goto without feeling dirty all over.

I lied above when I said every C# case block must contain a break statement because you can optionally replace the break statement with a goto statement. If you write your goto statement to go to the next case statement, you achieve falthrough. Moreover, if your case statements are later reordered, your gotos will preserve the original fallthrough ordering unless the gotos are also updated--a bit of a pain but worth the extra safety.

Here are two examples switching on ints and strings:

switch (1)
{
case 1:
Console.WriteLine ("case 1");
goto case 2;
case 2:
Console.WriteLine ("case 2");
break;
default:
break;
}

switch ("hello")
{
case "hello":
Console.WriteLine ("case hello");
goto case "world";
case "world":
Console.WriteLine ("case world");
break;
default:
break;
}