Wednesday, 28 March 2007

Running FxCop or Code Analysis

If you're fortunate enough to have one of the Visual Studio Team editions, then you have the inbuilt Code Analysis tool that you can run.

Otherwise, you can use the free FxCop tool

But what if you're in a team with a mix of Team Edition and Professional (eg. no Code Analysis)?

Add the following to the bottom of your project files and FxCop will be run on Release builds if you don't have the inbuilt Code Analysis tool installed:

<!-- Run FxCop if available on Release builds, but not if we also have Team Developer -->

<Target Name="AfterBuild" Condition=" ('$(Configuration)' == 'Release') And Exists('$(ProgramFiles)\Microsoft FxCop 1.35') And !(Exists('$(ProgramFiles)\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe'))">

<Exec Command="FxCopCmd.exe /file:&quot;$(MSBuildProjectDirectory)\$(OutputPath)$(AssemblyName).dll&quot; /out:&quot;$(MSBuildProjectDirectory)\$(OutputPath)\ccnet-fxcop.xml&quot;" WorkingDirectory="$(ProgramFiles)\Microsoft FxCop 1.35" />


Tuesday, 27 March 2007

MSDN Success Builder Modules

Microsoft have just released a whole lot of training "modules". I presume there'll be some kind of announcement or overview published shortly about them.

They seem to cover all kinds of topics related to development and developer practices.

eg. MSDN Success Builder Module 1-001 - Introduction to Agile Project Management

"Agile project management is more than a software production method. It is a philosophy—a grassroots movement to change software development by valuing individuals and interactions over processes and tools. Developers who understand and embody agile project management techniques will make their organizations more efficient and themselves more valuable. This comprehensive introduction features seven team exercises that teach agile concepts and a downloadable white paper for further study. 85-screen PowerPoint with 7 subsections plus PDF white paper. 4 hours."

Saturday, 24 March 2007

Vista and Daylight Savings

I logged into my Vista box tonight and got a nice surprise. A pleasant reminder that tonight the clocks wind back an hour!

Friday, 16 March 2007

Visual Studio 2005 Extensions for Windows SharePoint Services 3.0

This appears to be the RTM of the extensions for Visual Studio 2005 that improve support for developing Web Parts, site and list definitions. It also includes the "SharePoint Solution Generator". 

Thursday, 15 March 2007

Wednesday, 14 March 2007

Scrum for Team System v1.2

Scrum for Team System v1.2 has been released.

I don't know a lot about Scrum, other than it seems to sit on the Agile side of things, and describes itself as a "project management process" rather than a methodology.

I might install this on our TFS box and create a Scrum project to see how it looks.

Windows Server 2003 Service Pack 2

 I didn't know this was coming!

Service Pack 2 for Windows Server 2003. The update applies to the original release and R2.

There's also an ISO version and updated support tools (though the tools still aren't support on Vista).

VS2005 SP1 Update for Vista

This was a perfectly timed release - just before I reloaded my machine, the RTM of the Vista compatibility update for Visual Studio 2005. Install service pack 1, and then install this update. 

Saturday, 10 March 2007

Moving to Vista RTM

After a few test runs (including confirming that all my data was copied over to an external hard disk), I finally took the plunge yesterday.

I'm now running Windows Vista Enterprise, and one big change is that I've gone back to 32-bit. I'm a little disappointed as 64-bit was working pretty well, but there were a few things that didn't work at all, like Oracle client software and Centra (which forced me to run both inside Virtual PC)

I'm pleased to report that Oracle has installed ok now.

I also repartitioned the disk, so now I've got my data back on D: where it belongs. I did some rough calculations and decided on 60 Gigabytes for the primary C: partition.

Overall, RTM seems pretty solid. One good thing was that I noticed running SourceSafe now seems a lot faster than on the 64-bit RC2 environment. Don't know if it's the move back to 32bit or RTM that has fixed that problem - but a "Get Latest" was taking minutes to complete, and we're back now to a few seconds, which is much more respectable.

About the only thing I forgot to do before reformatting was to check-in some pending changes into our Team Foundation Server. Because I forgot to do that, it left the changes "orphaned" in the old workspace. This was causing some weird things to happen on the new install until I realised that it might not be happy using the old workspace in the new OS. Removing the old workspace and doing some careful updating (manually updating those files I hadn't checked in) and I'm ok now.

Wednesday, 7 March 2007

Asia Pacific SharePoint Conference update

It's now official, the conference that had been hinted at last month will be on May 15-16th at the Sydney Hilton Hotel.

Now to wait and see if there's enough "technical" content to make it worth me attending.

Preferred feed URL for my blog

My blog feed has been available through FeedBurner for a long time, but I've now changed the blog template so that it publicises the FeedBurner feed directly.

If you've subscribed to my feed, first of all "Thanks!"

I'd encourage you to update the URL to point to the new feed source. That way if anything changes in the future, you won't need to worry - it should all just continue to work.

Subscribe to Dave's Daydreams

Preparing for Vista RTM - backing up your profile folder

I'm preparing to re-install my workstation and go from Vista RC2 to the RTM version, now that we've got access to the volume license versions. As they are only "Upgrade" versions, I'm planning to try this workaround to achieve a clean install without having to install XP first.

When I installed RC2, I didn't re-partition the disk - I just left it as one big C: drive. This has now come back to haunt me, as it means in order to to a clean install of the new OS, I've got to move everything that I want to keep onto an external disk, and then copy it all back when the new OS is up and running. Previous machines have always had two drives, so didn't used to be such a problem.

I've created a batch file to run robocopy.exe (which is actually included in Vista now), so I can select which folders I want to backup to the external disk.

That all worked fine until I pointed robocopy at my profile folder.

Your profile is located in %USERPROFILE% in case you were wondering - on a clean install of Vista, that maps to a folder under C:\Users. The old "C:\Documents and Settings" as used by XP is still there, but it redirects to the new folder.

This is related to where things went wrong. The way Vista does the redirect is by using Junction Points - they're kind of like symbolic links in Unix. The trouble is that Junction Points are also used inside your profile folder to redirect from the old name (eg. "Application Data" to the new name "AppData").

I wondered why robocopy was taking so long, and then looked at what it was doing - it seemed to be copying the same files over and over again - and then I realised that's exactly what it was doing - it was stuck in a recursive loop because it kept hitting a junction point that took it one directory deeper each time. Eek!

So I stopped the batch file, but now I needed to remove the mess on the external disk. This handy batch file did the trick - curiously it also relies on robocopy to remove a directory heirarchy that suffers from "the path is too long" errors.

I'm now using an extra argument "/xj" with robocopy to tell it to ignore junction points and it should all be fine.

robocopy c:\users\username e:\users\username /mir /r:0 /xj

Monday, 5 March 2007

Listing installed applications on Vista 64-bit with WMI

There's a few sample scripts around to list the installed applications using WMI. The trap on 64-bit platforms is that the 32-bit and 64-bit installation information is stored in different places in the registry, and you need to be clever about telling WMI that you want the 32-bit data instead of the 64-bit.

Here's some VBScript that will list first the 32-bit and then 64-bit installed applications:

strComputer = "."
Const HKLM = &h80000002
Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
objCtx.Add "__ProviderArchitecture", 32
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

WScript.Echo "32-bit Applications"
WScript.echo "-------------------"

Call GetApplications

objCtx.Add "__ProviderArchitecture", 64
objCtx.Add "__RequiredArchitecture", TRUE
Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
Set objServices = objLocator.ConnectServer("","root\default","","",,,,objCtx)
Set objStdRegProv = objServices.Get("StdRegProv")

WScript.Echo "64-bit Applications"
WScript.echo "-------------------"

Call GetApplications

Sub GetApplications

' Use ExecMethod to call the GetStringValue method
Set Inparams = objStdRegProv.Methods_("EnumKey").Inparameters
Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "Software\Microsoft\Windows\CurrentVersion\Uninstall\"

set Outparams = objStdRegProv.ExecMethod_("EnumKey", Inparams,,objCtx)

For Each strSubKey In Outparams.snames

Set Inparams = objStdRegProv.Methods_("GetStringValue").Inparameters
Inparams.Hdefkey = HKLM
Inparams.Ssubkeyname = "Software\Microsoft\Windows\CurrentVersion\Uninstall\" & strSubKey
Inparams.Svaluename = "DisplayName"
set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)

if ("" & Outparams.sValue) = "" then
'wscript.echo strSubKey
wscript.echo Outparams.SValue
End iF

'Inparams.Svaluename = "QuietDisplayName"
'set Outparams = objStdRegProv.ExecMethod_("GetStringValue", Inparams,,objCtx)
'wscript.echo Outparams.SValue


End Sub

Oracle Databases on Windows Vista

Vista got released in November last year, and I've now come across the first "big" application that doesn't currently run on Vista.

Oracle will support Windows Vista but most likely not completely until the second half of 2007!

I would have thought a company the size of Oracle could dedicate a few resources to running their stuff on the beta releases of Vista, so that it wouldn't be such a big step to get it all working.

At least I don't do much Oracle stuff, but it does happen occasionally (like today), where it is a problem.

Windows Vista on ABC Adelaide Weekends

Who was that "David from Aberfoyle Park" who rang in last weekend to talk about his experiences using Windows Vista? 

How do I run FxCop during a post-build event?

Ha! Not only did my post to the FxCop forum turn out to reveal a bug in MsBuild, but David M. Kean referenced my fix in a posting to the The Visual Studio Code Analysis Team Blog

Thursday, 1 March 2007

Visual Studio Code Name "Orcas" March 2007 CTP

What was going to be the February CTP is now out, as the March CTP of the next version of Visual Studio.NET

This is the version that should have the latest working version of LINQ for SQL.