Monday, September 13, 2010

Hey It's Monday!

Usually I am not one to greet a morning with a smile, especially when it is a Monday morning. I usually think the creators of the English language were trying to tell us something when they made the words morning and mourning sound the same.
This morning though I am feeling positive. Not sure why that is. Maybe the fog in the air is letting me know that fall is here and the long hot summer is letting go. Maybe it is seeing Resident Evil 4 yesterday and knowing that there will be a Resident Evil 5 coming again at some point (more Milla in the future should bring a smile to anyone's face.)
All I know is today I am in a good mood and felt like sharing it.
Have a good day all!!

Friday, April 2, 2010

TiddlyWiki + Dropbox = Nice Personal Knowledge Manager

I have been trying to find a good way to manage all the little pieces of knowledge I pick up through the day. In the past I would either just file them away in my already way too cluttered brain or scribble them down in a notebook or some such (which I usually lose!). If you have read "Getting Things Done" you know this is not very reliable.
One thing I have been doing recently is using a personal wiki application called TiddlyWiki. This is a single html file you save locally and update and customize as needed. I then found that if I save this to a folder in DropBox. This allows me to access it from any of the computers I use throughout my day or even from my BlackBerry (Read-only) via the DropBox website.
While this doesn't meet all of my needs and wants, it does get me by until I build my own wiki application that does all that I want it to do.

Monday, March 1, 2010

Slides from Intro to WIF at CAPAREA.net

Been a little slammed since I presented at caparea.net on "Introduction to Windows Identity Foundation (WIF)" last week so have been slow about getting my slides and source code up.

My slides can be found at: Slides
I will be pulling a step by step process for the demo's instead of providing source. Look for those sometime later this week.

Sunday, November 8, 2009

TDD Kata Presentation at CMAPP Yesterday

Yesterday I got the chance to present my TDD Kata at CMAPP Code Camp and had a blast.
Will post something later discussing my take on TDD Katas and how they can fit into a developers life.
For now though here is a link to the presentation files on GitHub. TDD-Kata-Presentation---CMAPP-Fall-09.
To run the tests you will need Gallio installed.

Friday, January 9, 2009

Setting up an ASP.NET MVC Project using TortoiseSVN and Unfuddle – 2. Creating the VS Solution

So Far

In the last post, I walked through the steps to create the folder structure and checking it into my Unfuddle repository. Now we will pick up from there and create our Solution file, MVC/Test projects, verify it builds, and check that into the Unfuddle repository as well.

A few prerequisites

  • Visual Studio 2008 – SP1
  • ASP.NET MVC Beta
  • XUnit – with the Visual Studio plugin installed (you could do this with MS Test as well)

Creating the Solution File

When creating a new solution I lean toward setting it up first using a Blank Solution so that I have a little more control over the process. You can just let it create it automatically when you create the MVC Project but you don’t get as much control over the folder structure within your project and may need to go back and manually move things anyway. I just do it as I go.

Open Visual Studio and click on File –> New –> Project

Once it opens select Visual Studio Solutions under Project Types.

Then select Blank Solution, enter the solution name, enter the path in your local repository coresponding to trunk\src and click OK.

Snap10

Now this what gets created:

Snap11

You will notice that the sln file was created in a new mymvcsolution folder which I really don’t want. I will just close Visual Studio, cut the files and paste them into the src folder and then delete the unwanted folder. ALl the mappings within the file are relative so once the files is moved all is good.

Create the MVC/Test Projects

Now click on the sln file to reopen Visual Studio.

Click on FIle –> New –> Project

Snap12

Under Project types select Visual C# –> Web and the ASP.NET MVC Web Application.

Enter mymvcapplication for the name, verify that it is using the trunk\src folder as the Location and for Solution it should use Add to Solution.

You should now get the following prompt:

Snap13

I have selected xUnit but you could also go with MSTest at this point .

Now if you try to build at this point you will get 5 identical fails:

“The name 'GlobalApplication' does not exist in the current context   C:\projects\mymvcproject\trunk\src\mymvcapplication.Tests\Routes\RouteFacts.cs”

When you navigate to the code you will find the following:

   1: GlobalApplication.RegisterRoutes(routes);




The problem is that the GlobalApplication is named MvcApplication in Global.asax.cs. If you update this in each of the tests to:





   1: MvcApplication.RegisterRoutes(routes);




Then build again it will all be successful.


 


A Little Tuning



If you look in the trunk\src\mymvcapplication.Tests folder you will find a folder called 3rdparty and remember we created a folder in the trunk called thirdparty. When I add more test projects I will either need to reference this file or have another copy of this file in each project. I would prefer to move this to the folder I created for this purpose. So I will cut the xunit.dll from this folder and paste it into my thirdparty folder in the trunk.


 


Then I will delete the 3rdParty folder from the test project.


One last thing I need to do is in Visual Studio in the references, I need to remove the current xunit reference and add the new one by right clicking on references


Snap14


Click Add Reference:



Snap15



Click on the Browse tab an d navigate to the trunk\thirdparty, select xunit.dll and click OK.



If you build the solution now you will find it builds fine.



If you want to see success hit F5 and click ok on the warning to enable debugging in your web.config. You will see this:



Snap16



Now I will close Visual Studio and Check in.



Checking In



I will now navigate to the trunk folder and right click on the mymvcproject(root) folder and right click on the trunk folder and click on SVNCommit:



Snap17



I will then click the select all box but then deselect the contents of the bin folder, add a message like “Initial Project Checkin” and click OK. The following dialog will show the files being added and uploaded and the success message (hoepfully):



Snap19 



Now when I open Unfuddle and check the repository I see the files I checked in so we are done!



Ok well done is a strong word really we are ready to actually get started but now we have a place to work and if we check in religiously we have some backup for code changes and such.



Later I will visit how to set up a continuous integration server with CruiseControl.NET so that you can get validation that your checkins don’t break the build.



Please let me know any comments you may have.

Thursday, January 8, 2009

Setting up an ASP.MVC Project Using TortoiseSVN and Unfuddle – 1.Local Repository Structure

1. Create a Repository

The first step is to create a repository in your Subversion server. In my case since I am using Unfuddle I will create it using the web page.

Snap1 

2. Setup the local Folder Structure

In Windows Explorer create a folder to house your project, in my case I will create it a c:\projects\mymvcproject

Within that folder we will create the following folders:

  • trunk – will contain the main project files.
  • tags – will contain versions of the project as they are released
  • branches – will contain any temporary versions like patches

Now tags and branches we will leave alone for now and focus on setting up the trunk folder. Within it we will create the following:

  • src – will contain the actual VS solution files
  • thirdparty – will hold any external resource libraries that will be used by the solution
  • docs – will contain project documentation

Your folder structure should look like this:

Snap2

3. Import the Folder Structure into the Repository

Now open up in the c:\projects folder (or whichever folder you created the structure in) and right click on the mymvcproject folder and select TortoiseSVN –> Import…

Snap3 In the Import form enter in the URL of your repository and click OK.Snap4

After entering your username and password, you will see the files imported. At this point the folders have not been added to the repository yet. We must now checkin the files to complete the process.

4. Checkin

Now right click on the mymvcproject folder and click on SVNCheckout.

Snap5

Enter the URL of the repository as before and the path to your mymvcproject folder and click OK

Snap6

The files will be checked and and you should see this:

Snap7

Now if you go into Unfuddle and look in your MyMVCProject you will see that the folders have been added as expected:

Snap8

Continuing

In the next post I will cover the creation of the Visual Studio solution and ASP.NET MVC Project.

Wednesday, January 7, 2009

Setting up an ASP.MVC Project Using TortoiseSVN and Unfuddle - Introduction

Introduction

I am in the process of beginning a new personal project using ASP.NET MVC. The actual project is something I really don’t feel like boring anyone with as it is just something I have been kicking around for a while. The important part of mentioning it, is that, as I am working my way through this project, I will pick key decision points and try to blog about the decision I reach.

The drivers for doing this are to force me to think it through a little more thoroughly, since who wants to blog something only to have someone point out something obvious, and to help me fine tune my skills at communicating the approach.

Will I get everything right? I doubt it, but it will serve as a conversation starter, at the least and hopefully in the end provide some guidance to others finding their way as well.

Getting Started

As I want to try to get the project off the ground to a relatively organized start. I am planning on using Unfuddle as my source control provider and TortoiseSVN as the tool to send updates to Unfuddle. The driver for this is giving me some ability to rollback changes that don’t work. I also get an easy way to keep versions of my code straight on my commuting laptop, my home desktop machine and possibly with other developers if the project seems to have some possibility of going somewhere.

Later I plan to implement continuous integration using Cruise Control.NET to allow me to automate builds to a demo environment to kick the tires as I move forward.

The steps I am going to walk through in this series of posts are the ones to create the initial project structure, tune them a little easier to manage and get them checked in to my new repository.

The actual process is this:

  1. Creating the Local Project folder structure and import it into a New Unfuddle Repository

  2. Create the Visual Studio Solution, MVC and supporting projects and tune them a little

  3. Import the new solution to Unfuddle

As I go through these feel free to post comments and feedback.

Enjoy!