So, I am a big fan of putting build numbers or SVN revisions into the AssemblyFileVersion of my assemblies. I can then use a little bit of the System.Reflection API to get the AssemblyFileVersion, and display it to the user, write it to logs, etc..
However, I ran into a hitch when working with Office 365. Although reflection worked fine on my local machine’s sandbox, I got an error when I tried to run the same code on Office 365’s SharePoint system. It was pretty obviously and emphatically using System.Reflection that was the problem.
This was a shame, as my build process is (as usual) putting the AssemblyFileVersion in. Sadly, I don’t see any easy way to get the AssemblyFileVersion value from within Office 365 code. So, alternatives? Continue reading “TFS, Versioning and Office 365 SharePoint”
I’ve just had a bit of a problem with Solution Explorer in Visual Studio not showing the ‘checkout status’ icons from TFS – you know, the red tick, the padlock, etc.. These things:
I couldn’t figure out what was causing this, but found the solution on MSDN forums:
In VS 2010, while you have the solution open in Solution Explorer, select File-> Source Control-> Change Source Control, could you click on Bind for each project/solution? Binding provides version control functionality. This includes various version control icons that indicate status in Solution Explorer.
This advice was correct – I went to the binding dialog, and the solution and projects weren’t bound. I added the bindings back – and presto. I’m not sure, however, how the project became unbound…
As mentioned before, I’ve been automating the building and analysis of our SharePoint code, and this led me to ask, can you run SPDisposeCheck as part of a TFS build process?
Yes we can. Richard Fennell has a concise and simple description of how to do it. It’s best to read that, but in case that site goes down, the short of it is – use InvokeProcess to run SPDisposeCheck, and it’ll return a value that is the number of errors/warnings it finds. I find that that’s enough to choose whether to write a warning to the output of the build, and I don’t then parse and write the individual warnings into the build. These should be captured by the build log, and they’re pretty obvious, so it doesn’t seem worth the hassle. You could do it if you really wanted to.
Don’t forget you can use attributes to prevent false positives – though I still have issues with anonymous delegates that are false positives (how do you add the attributes?), and that’s what’s causing the two warnings above.
So, we’ve been working on putting our SharePoint solutions through a proper build process in Team Foundation Server 2010 (TFS), and I hit a bit of a snag.
I had been given a build definition that had a build process – a Workflow Foundation workflow – that I wanted to alter. The problem was that while I had the XAML file for that workflow, and the DLL that defined some custom code activities that the process used, I didn’t have a full Visual Studio project for it. No problem, I thought, I’ll just open the XAML up in Visual Studio and edit it.
Continue reading “Editing a XAML build process”
As mentioned before, we’ve started to use SmartAssembly to obfuscate some of our products. We also use Team Foundation Server (TFS) as source control and build server. Using obfuscation with code analysis caused some issues, which were compounded by our check-in policies. Continue reading “Obfuscation, Code Analysis, and Check-In policies”
With SharePoint 2007, WSPBuilder became our standard packaging tool for SharePoint solutions. It was simple, powerful, and a damn site easier than trying to write your own manifest.
Well, SharePoint 2010 and Visual Studio 2010 followed later, and Microsoft introduced much better tooling of their own. However, we’ve still got a lot of code being packaged by WSPBuilder, and we didn’t want to have to refactor all those projects just to package them for 2010.
Fortunately, Carsten Keutmann wrote a 2010 version (still in ‘BETA’, but it works fine). It offers many of the same extensions to Visual Studio as the previous version did.
However, I recently had to automate (in Team Foundation Server 2010) the build of one of our WSPBuilder based solutions, and that’s where things got more interesting… Continue reading “WSPBuilder 2010 and TFS2010”