Sunday, November 8, 2009
TDD Kata Presentation at CMAPP Yesterday
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.
Now this what gets created:
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
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:
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);A Little Tuning
Click Add Reference:
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:
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:
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):
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.
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:
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…
In the Import form enter in the URL of your repository and click OK.
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.
Enter the URL of the repository as before and the path to your mymvcproject folder and click OK
The files will be checked and and you should see this:
Now if you go into Unfuddle and look in your MyMVCProject you will see that the folders have been added as expected:
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:
-
Creating the Local Project folder structure and import it into a New Unfuddle Repository
-
Create the Visual Studio Solution, MVC and supporting projects and tune them a little
-
Import the new solution to Unfuddle
As I go through these feel free to post comments and feedback.
Enjoy!
Saturday, December 27, 2008
Currently Reading: Getting Things Done: The Art of Stress-Free Reading
Amazon.com: Getting Things Done: The Art of Stress-Free Productivity: David Allen: Books
So far trying working through all my current todo’s and organize them into a set of lists stored in Remember the Milk lists. Finding it really handy to have my current items visible on IGoogle. Also like the ability to send an email and have it show up in my RTM inbox.
My Essential Tool List | Caffeinated Coder
Read this blog entry about a few weeks ago and have added a few of them to my list of tools I use everyday.
My Essential Tool List | Caffeinated Coder
Remember The Milk is one I have found especially useful.
executor is a very useful Application Launcher as an option to Launchy or SlickRun.
2009 Plans for Buck the Coder Blog
2008 is drawing to a quick close and like most people I am taking some time taking stock of where I am in my all parts of my life.
As part of that, I thought about this blog. Buck the Coder is a blog I created a while back to begin to find my professional voice outside of the comfortable work environment and try to become a more active part of the community that, as a .NET developer, I gain a lot of value from.
I read a fair amount of blogs and other web content everyday and find lots of it useful, enlightening, inspirational and entertaining. I also find a lot that is infuriating and contrary to what I think or have found from experience and often I take some time and investigate further to determine what is correct and change my opinions as needed. Most of these insights I have a tendency to keep to myself or share with a few of my colleagues when the topic comes up.
I have never been the most outspoken person, usually I am the quiet person that only speaks up when I am sure of my position or when I am comfortable with my surroundings and confident of how it will be received. I have been on my team for a long time and have a fair amount of past success in my career so at work I have a place where I can find my voice in most cases. Outside of that though there are very few places I can feel comfortable raising my voice.
I have decided that using this blog to begin to find my voice is a sound idea, if only I can get myself to actually do it and to that end I am going take the following steps:
Clearly Define Why I am Doing It
For most anything you try to accomplish, if you are going to succeed you need a clear view of why you should do it. If you don’t have that in mind it is unlikely that you will get very far.
My key goal with this blog is to share my experiences of being a .NET developer as well as any insights or questions that are found along the way with the hope of either making someone else's path a little easier.
Make Time For It
I have a lot going on in my world and so if this is going to happen and be worth anything, I need make sure there is a process and time for doing it. So I am going to do the following:
- Write down any thoughts or ideas I have as I go about my day.
- Each night I will sit down and pull together those notes save the ones that are worthy of more thought.
- For any short thoughts or ideas that I think are either useful or worthy of discussion I will post a quick entry.
- For ideas that need more examination I will decide what the next step is and set aside time to do that.
- There are a few high level goals I have for next year, like getting my certifications, I will blog about these in more detail.
Blog as a Fellow Traveler
One of the roadblocks I have had in the past is my not feeling like an expert and seeing why anyone should care what I write. What I have found though is that the blogs I read and get the most value out of are the ones from people who are just sharing what they do and think and readily admit they don’t have all the answers. So I will write what I do and think, welcome others to tell me what they think and listen to what they say.
I wish anyone reading this a Happy New Year and invite you to take some time now and again to read this blog and provide me any feedback you may have.
Buck