What to do now - Sprint Planner Helper Initialization

I’m free!!! So what do I do now. I have been talking to my colleagues that now that don’t have to do boring work with them ;) I need another project in order to stay in touch with the IT-business. Here is the reasons for me doing this at all: Have fun! - the second it’s boring or takes to much time I’ll end it. Promise To learn about DDD, TDD and ASP.NET MVC. These three things has attracted a lot of my interest I would like to try them out out. Oh yeah - it will be in C#! No more VB.NET for me - thank you very much. Cannot take to much time (max 1 hour a day) - as stated earlier. I am not working! Document my progress here on the blog. This idea is a complete rip off from a lot of different places, but I...
Read More

Clean code - the pragmatic approach

As I wrote in the previous post I am right now reading Clean Code by Robert “Uncle Bob” Martin. It is great! But having 200 hundred pages book that contains rules about how to code will pretty soon get hard. Especially if you try to adopt it in a team. A while back we discussed an essay by Jeff Bay called Object Calisthenics a lot in the Microsoft community at Avega. This is a very pragmatic approach with 9 rules that states how to code. Here is a pdf-version of the rules. What I found was that many of the rules that Uncle Bob is talking about in Clean Code will be followed automatically if you adhere to the rules in Object Calisthenics. I’ll try it out sometimes - but it looks like a quite bitter pill to swallow when you look at the list… Brrr
Read More

Last day - new chapter

I have come to a fork in the road of my life (that almost sound like a poem :)). Today is the last day on the assignment where I have, as ever, learned a lot. This time I have picked up SOA, WCF, TFS, AOP and build scripts - and of course SCRUM. The Scrum part of this was almost a religious experience.  I am a different and better consultant after learning SCRUM. I won’t ever go back. The future hold six months together with Albert and Elin. I will be “daddy-free” (direct translation of “pappaledig” for all you Swedish readers). This is a truly amazing thing that we have in Sweden where you actually get money from the government to be home with your kids. Amazing! Elin is working nights right now which means that she has a lot of free time during days. This means that we can...
Read More

Create textfile on the fly in build scripts

Yesterday we did a final touch to our build script (by we I mean “I talked about it for five minutes, Christer did it”). We wanted to create a bat-file that installs our database in a certain version to a certain environment. So - the information we need to be able to do that is only know at runtime in the build-script. From what I could remember there was a MSBuild community task for this - this was my input. Christer then found the task WriteLinesToFile and wrote the following target that creates a bat-file as above. <ItemGroup> <CmdLine Include = “@ECHO OFF”/> <CmdLine Include = “ECHO About to install version $(BuildVersion) on environment $(DeployEnv)”/> <CmdLine Include = “SET /p passw=Enter DB password for $(DeployEnv): “ /> <CmdLine Include = “CALL main.bat $(DeployEnv) . $(BuildVersion) %passw%”/> <CmdLine Include = “PAUSE”/> </ItemGroup> <WriteLinesToFile File=”$(PublishWebSitePath)\Database\Installera_$(DeployEnv)_version_$(BuildVersion).bat” Lines=”@(CmdLine)” Overwrite=”true”/>   This version will wait...
Read More

NMock2 RemotingException ByRef value type parameter cannot be null

OK this might be the most misleading error message I’ve seen. I cannot decide on how to describe it… What this means… or what this try to … Actually this happens when one of your mocked objects is mocking a method that returns something and your mocking doesn’t return anything. Eeeeh - that was quite tricky. Got it? Here is an example: When I mock this method: Public Class FacadeObject       Function CreateSomeThing(ByVal aName As String) As Long                End Function         End Class by using the following code to do the mock Expect.Once.On(m_mockadFacadeObject).Method("CreateSomeThing") an exception of RemotingException (ByRef value type parameter cannot be null) will be thrown. Here is another description that you might find easier to understand
Read More

Update AppSettings with XmlUpdate in build scripts

I know I will chase this one for ever if I don’t put it up here… We ran into a situation where we needed to tweak the AppSettings-section of an configuration before tests in the build script. Luckily there is help to be found. With the XmlUpdate-task (in the MSBuild Community Tasks) this can be accomplished. IF you know how to write the XPath-query. Here is how (found it here): <XmlUpdate Namespace=”http://schemas.microsoft.com/.NetConfiguration/v2.0” XmlFileName=”$(SourceDir)\Core\ABSuite\ABClient\App.config” Xpath=”//configuration/appSettings/add[@key=’Main.ConnectionString’]/@value” Value=”$(DatabaseConnectionString)” /> Also here is a great site to pick up some XPath-skills.
Read More

How to read other exe's config

When we’re doing integration tests we need to find some settings from the exe (yes, we’re batching some stuff - I am sorry ;)) that we are testing. Instead of copying it into the test app.config I discovered a way to read another exe’s configuration - OpenMappedExeConfiguration. Very useful if a tad … ugly maybe.
Read More

ASP.NET MVC Storefront

I have been watching the first three in this series and not only are they a great introduction to ASP.NET MVC, they also introduce TDD in a very methodical and nice way. Follow along here - http://www.asp.net/learn/mvc-videos/#MVCStorefrontStarterKit
Read More

Custom tool warning cannot import wsdl:portType

I chased this bug for a while - more and more frustrated… This was what happened: I updated a WCF Service Reference and got this error (or actually warning) in the Error List of Visual Studio. Also I saw that the Reference.vb was totally empty. OK - after some trying of my own (why do I do that over and over? Don’t think - steal from others…) I though of searching the Net and of course found the answer in five seconds. Here is a guy that solved it - but the header and description of the post is quite different so I’ll try to give my own explanation here. In the Configure Service Reference… dialog box there is an option “Reuse types in referenced assemblies”. Exactly what that means is hard to grasp (<a href=”http://www.google.com/search?hl=en&q=” data-reuse+types+in+referenced+assemblies”&meta=” target=” data-_blank”=”“>just try for yourselves</a>) - but I understand it as the tool...
Read More