Thoughts from Dan Miser RSS 2.0
# Sunday, 17 July 2011
I've been ussing CC.NET for probably the last 5 years with good success. At work, we recently migrated to TFS 2010 (installation and configuration are brutal, but it's sort of nice when it all works). I figured I'd take this time to look around and see what I've been missing on the continuous integration scene for my personal projects. The 2 leading contenders were TeamCity and Bamboo. I went with TeamCity since I use ReSharper, and think the JetBrains guys are pretty top-notch.

Installation was drop-dead simple. Configuring was pretty straight-forward, but I had an assist from StackOverflow, which led me to this amazing article/series by Troy Hunt. After following Troy's instructions, and slightly adjusting for the obvious version differences, I had things up and running, with a completed build inside 15 minutes.

I also configured the Build Triggering step because I want the build to fire off each time I checkin. I've got a few things to take care of (notifications of broken builds, code coverage, etc.), but it looks like this is a much easier application to configure than CC.NET.

Sunday, 17 July 2011 02:36:26 (GMT Daylight Time, UTC+01:00)  #    Comments [1] -
# Wednesday, 24 February 2010
I use list binding in my ASP.NET MVC applications in several places. When it works, it is truly magnificent. When it doesn't, it's just maddening. Here's a quick heads up for those of you that use list binding in MVC. You would expect the following 2 lines to render the same HTML, but they don't. To get list binding to work, you need the HTML to read something like this (I'm just listing the attributes in question here):

<input name="Results[0].Score" />

The old TextBox helper works fine, since you're assigning the name attribute:

Html.TextBox("Results["+id+"].Score", Model.Score)

This code, however:

Html.TextBoxFor(r => r.Score, new { name = "Results[" + id + "].Score" })

produces the following output, which means the Score property won't get bound properly.

<input name="Score" />

The problem is that in the TextBoxFor code, the name attribute is ignored. To be more precise, the custom name is added, but the attribute is then replaced by the name derived from the model.

Wednesday, 24 February 2010 04:12:13 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Sunday, 08 November 2009
Telerik just released an extremely impressive library of components (Grid, Menu, TabStrip, and MenuBar), written for MVC. They are truly first-class, from the architecture, to the development experience, to the finished screens that your user sees. They released them as open-source, and even better, these controls are written from the ground up to support ASP.NET MVC.

Be sure to check out this awesome write up on how to Use the grid in a CRUD scenario. Very nicely done.

I'm not a fan of the whole "Edit/Delete" action column. I'd much rather just have a link on the column to take me to the detail screen. Here's the way I solved that:

    <% Html.Telerik().Grid(Model)
        .Columns(columns =>
            columns.Add(o => o.CollectionDate).Template(c => { %>
                <%= Html.ActionLink(c.CollectionDate.ToShortDateString(), "View", new { Id = c.Id })%> <%
            columns.Add(o => o.Location.Name).Width(40);
Sunday, 08 November 2009 03:00:21 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Wednesday, 22 April 2009
Are you looking for a strong developer/architect with a serious passion for all things technical and a unique blend of experience? If so, feel free to email me. My main focus over the past couple of years has been on things ALT.NET-ish (e.g. ASP.NET MVC, NHibernate, Spring.NET, etc.) while I have delved into a variety of other technologies as well (e.g. Mindscape LightSpeed, LINQ, Dynamic Data, Delphi, etc.). If you know of an opening - contract or full-time - please keep me in mind. I'd prefer to remain in the Milwaukee area, but occasional travel wouldn't be the end of the world.

Until the next technical post here, take care and thanks in advance.

Wednesday, 22 April 2009 19:29:54 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
.NET | ALT.NET | Delphi
# Wednesday, 18 March 2009

We ran into a problem using OpenSessionInView on an IIS7 server. It turns out that when running in IIS7's new Integrated Managed Pipeline mode, we would get this error when trying to access lazy loaded objects:

Could not initialize proxy - the owning Session was closed.

For now, we just set the Managed Pipeline mode to Classic and things work fine again. When we get time, we'll be looking to try this configuration.

Wednesday, 18 March 2009 00:47:45 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Friday, 13 March 2009

The first time you load an assembly of Quartz.NET jobs, it populates the database with the current trigger information (cron vs. simple, timings, etc.) that it finds in the configuration file. It appears that this information does not get updated once it's in the database. So if you want to make a change to set the trigger time to be every minute instead of the original version of "run every day at 2am", you will be waiting for a loooong time to see that trigger fire (unless you start at 1:59am :)).

Since I'm using Migrator.NET to control my database schema, I can easily drop the tables and recreate them. This isn't a big deal because once I have things tested, I won't need to change the trigger information, but it did trip me up for a bit so I thought I'd share.

Friday, 13 March 2009 04:47:18 (GMT Standard Time, UTC+00:00)  #    Comments [2] -
# Thursday, 12 March 2009
I came across this exception today when inserting multiple objects through an NHibernate SessionScope:

NHibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 0, of class: Foo.Entity.Bar
   at NHibernate.Impl.SessionImpl.DoSave(Object obj, Object id, IEntityPersister persister, Boolean useIdentityColumn, CascadingAction cascadeAction, Object anything)
   at NHibernate.Impl.SessionImpl.SaveWithGeneratedIdentifier(Object obj, CascadingAction action, Object anything)
   at NHibernate.Impl.SessionImpl.Save(Object obj)

I didn't see much out there on this, but Geoff Lane picked up on it pretty quickly. It turns out that my Bar.hbm.xml mapping file had set the id generator incorrectly to "generated", which was a problem because it was actually a MSSQL IDENTITY field. The mapping should have looked like this:

<id name="Id">
  <generator class="native" />

Luckily for me, I had run my tests by trying to insert 2 entities inside the session so the error bubbled up right away.

Thursday, 12 March 2009 02:06:02 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Tuesday, 10 March 2009

Yesterday, I had to upgrade from Spring.NET 1.1 to Spring.NET 1.2 in order to use Quartz.NET. After doing that, I started to get InvalidCastException errors in my unit tests that told me I couldn't convert an int to a Nullable<int>. Things like this were broken:

void TestMe(int? id) 
  // do testing here

// and elsewhere, we call it like this

Very strange. It turns out that this is a known (and fixed) issue due to using Nullable types through AOP. I grabbed the latest nightly build and all of the tests passed again.

However, when running, I found a breaking change in the post-1.2.0 code that I needed to correct, namely:

Overriding the SessionFactoryObjectName in web.config no longer uses Spring.Data.NHibernate.Support.OpenSessionInViewModule.SessionFactoryObjectName as the key. Now, you need to use Spring.Data.NHibernate.Support.SessionScope.SessionFactoryObjectName. e.g.

<add key="Spring.Data.NHibernate.Support.SessionScope.SessionFactoryObjectName" 
  value="NHibernateSessionFactory" /> 

Now everything is upgraded and working again.

Tuesday, 10 March 2009 19:02:30 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Monday, 29 September 2008

Please RSVP to ASAP if you plan on making this Wednesday's ALT.NET meeting, where we can hopefully cover mocking.

When: 10/1/08 @ 7pm

Where: 10000 Innovation Drive, Suite 260 (SpiderLogic office)
Monday, 29 September 2008 15:58:05 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
# Wednesday, 03 September 2008

Due to lack of responses, I'm canceling the ALT.NET meeting for tonight. Please mark your calendars for Wednesday, 10/1/08 for the next meeting, where we will try to cover mocking.


Please send me an email at if you plan on making it in October.

Wednesday, 03 September 2008 17:19:19 (GMT Daylight Time, UTC+01:00)  #    Comments [1] -
# Wednesday, 27 August 2008

Now that summer is drawing to a close, it's time to think about a meeting of the Milwaukee ALT.NET minds again.

When: Wednesday, September 3rd, 2008 @ 7pm
Where: 10000 Innovation Drive, Suite 260 (SpiderLogic office)

I'm hoping that the topic will be mocking, but I'm open to other suggestions.

If you can RSVP by sending an email to me at, I'd appreciate it. That way, we can start to get a handle on head count and have enough food on hand for everyone. Thanks, and hope to see you there.

Wednesday, 27 August 2008 17:27:43 (GMT Daylight Time, UTC+01:00)  #    Comments [0] -
# Wednesday, 07 May 2008
Sorry for the late notice, but we're going to have to cancel the ALT.NET meeting for this month. We'll get things geared up again for next month.
Wednesday, 07 May 2008 18:32:48 (GMT Daylight Time, UTC+01:00)  #    Comments [2] -
# Monday, 17 March 2008

Nikhil Kothari wrote a brilliant blog post titled Ajax with the ASP.NET MVC Framework. In that post, he built a demonstration TaskList application that used Ajax and the ASP.NET MVC framework that Microsoft is working on. Microsoft is doing a good job in releasing more frequent updates to this framework, but that means that there will be pain when moving from one release to the next. The ASP.NET MVC Preview 2 release was no exception to this rule. There were a list of documented, tedious and manual steps that one needed to follow to get their old code running with preview 2: update web.config, change the route description, update assembly dependencies, etc.. There were also other items that were not so well-documented:  add ProjectTypeGuids to the csproj file, methods that fell out of the preview 2 release (e.g. ViewFactory.CreateView), etc.

I updated Nikhil's code, and some basic testing shows me that it's working with the preview 2 bits. Download the updated code here. Please leave a comment or send me an email if you see any errors that need to be corrected.

Monday, 17 March 2008 18:21:14 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Friday, 07 March 2008

ASP.NET MVC Preview 2 was released yesterday. I've had a chance to install and play with it, and I hate to report that I am underwhelmed. My thinking leads me to believe that MS rushed this release out the door just to be able to say they shipped something at MIX. While there has been good progress made on several issues (e.g. medium-trust support, public methods are callable by default, and route setup is improved). However, I find several other things lacking, referenced from ScottGu:

  1. Source code is not released. Sure, it might be coming "soon", but why not have everything coordinated and ready to go? Hitting an arbitrary deadline of "ship while at MIX" is less important to me than having answers to questions like these.
  2. Dynamic Data (scaffolding) will not work with Preview 2. It is almost always inexcusable to take functionality and features away. The ability to scaffold is one of the coolest things in Rails. Having something similar in ASP.NET was a welcome treat. Now it's gone. Again, I'm sure there is something that will be released "soon", but why not have everything ready to go? I hate not only playing catch up years later, but having a taste of it, only to have it yanked a few weeks later.
  3. The "choose your unit testing framework" feature that was hyped up ships with only MSTest enabled. I understand that MS is working to enlist support from the various unit testing groups to add their tool to the list, but it seems disingenuous to post mocked up screen shots with test frameworks in a combo box that were never developed.
  4. Others have pointed out some more detailed issues that need solving to help with testability (e.g. see here and here).

I look forward to seeing these issues addressed ASAP because I absolutely LOVE the promise that the MVC bits hold.

Friday, 07 March 2008 19:30:33 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Thursday, 06 March 2008

All in all, I was very pleased with the inaugural meeting of the Milwaukee ALT.NET group. We had a turnout of 10 people, which exceeded my expectation in quantity, and the quality was quite good, too. We talked about general architecture topics for about 45 minutes, and then Todd Penland led the group in discussion on persistence and the Unit of Work pattern. We talked about various alternatives to building this yourself (e.g. NHibernate), and talked about the pros and cons of this approach (i.e. requiring a topological sort to deal with database changes properly (something near and dear to my heart from when I was writing code for MIDAS/DataSnap and BDP), handling object graphs, requiring a MarkDirty() call in the property setters, etc.). It was a very engaging discussion. Thanks to everyone who showed up, and to SpiderLogic for providing the refreshments.

Here are the details for next month:

When: Wednesday, April 9, 2008 @ 7pm
Where: 10000 Innovation Drive, Suite 260 (SpiderLogic office)
What: Dan Piessens (who is on the advisory panel for Unity and EntLib 4.0) will cover Unity and EntLib 4.0

I'm looking forward to it, and hope you are, too. If you're planning on being there, please send me an email to, or leave a comment here. That way I can plan the food and refreshments accordingly. Feel free to drop me a line on topics you'd like to see covered, too.

Updated to change the date to April 9th. This date change will allow us to hopefully get more exposure thanks to Scott Isaacs and the WI .NET User Group. Thanks, Scott!

Thursday, 06 March 2008 16:35:55 (GMT Standard Time, UTC+00:00)  #    Comments [1] -
# Tuesday, 26 February 2008

A co-worker of mine, Brian Kapellusch, is working on a web framework to give us a garden path for ASP.NET applications. The code that he's writing (and the code to use it) is trés elegant. One of the underpinnings of this framework is his use of the ObjectDataSource class (ODS). I am making heavy use of NHibernate and Spring.NET in this application as well. My understanding of the ODS told me that if I wanted to control how the source object was created, that I simply needed to handle the ObejctCreating event and assign the desired object instance in that event to e.ObjectInstance (see here for some more usage examples).

However, it turns out that is not enough to fully control when an object gets created. If you set the TypeName property to a concrete class, ODS will also create a new object behind the scenes - even if you have handled the ObjectCreating event. This becomes very problematic when using an IoC container to automatically build up and inject properties into your class.

The bottom line is this: If you see one version of your object that has things built up properly (because the IoC container was used properly), and one version that has null properties (because, in essence, ODS called "new MyClass()" for you, which doesn't let the IoC container do it's job), you should change the TypeName to point to the interface type instead of the concrete class type. Much thanks to Brian for this one.

Tuesday, 26 February 2008 00:36:54 (GMT Standard Time, UTC+00:00)  #    Comments [1] -
# Tuesday, 05 February 2008
I'm using NHibernate a lot more lately, and it's been working great. One of the downsides, though, is the fact that you need to build up the mapping files by hand. Well, no more. I stumbled upon the open source project, active-record-gen, on Google Code. One of the templates that it provides is one that will generate NHibernate mapping files for tables in an MSSQL database. I tried this on a couple of databases and it works rather well.

A few small suggestions:

  • Implement a better pluralization/singularization strategy by using Inflector.NET.
  • Work with more databases than just MSSQL.
  • Allow for the connection string to be built up with more options. Right now, it requires SSPI integration, and attached databases don't work as well as they should. See here for more details.
Tuesday, 05 February 2008 13:57:18 (GMT Standard Time, UTC+00:00)  #    Comments [0] -
# Friday, 01 February 2008

I would like to take it upon myself to announce the formation of the Milwaukee chapter of the ALT.NET UserGroup. It will meet the first Wednesday of every month, with the first meeting to take place on 3/5/08 @ 7pm at 10000 Innovation Drive, Milwaukee, WI. Pizza and drinks will be served, and the event will be free to attend. Thanks to SpiderLogic for sponsoring the first meeting.

This group will cover agile development tools and techniques with .NET, best practices for architecture and coding, emerging technologies, and anything else the group decides to cover. For more backstory on ALT.NET, read this post. The use group will be a very participant-driven group. I will not look to lead this group in any significant way, other than to call this group to order, and get people involved in sustaining it. I've learned from other user groups that if a group is too dependent upon one person, it is a matter of time before it fails.

For the first meeting's agenda, I propose we get some volunteers to take on some minimum responsibilities and then break into an OpenSpaces format, where technical topics will be presented by anyone who wants to present. I don't want this to be yet another 1-way presentation medium for 1-2 hour topics, so be prepared to be engaged, discuss, and share (bring your laptop to showcase code and/or slides). I'll take a swipe at talking about ASP.NET MVC this first meeting. If you have something you want to see covered, or especially if you want to cover something, post a comment, and we'll get it on the agenda.

Please pass this notice around to anyone you think will be interested! If you plan on attending, I would appreciate either a comment on this blog or email to, just so we can gauge how much food and drink to have on hand. I am really excited about this, and look forward to seeing everyone there!!

Friday, 01 February 2008 21:46:14 (GMT Standard Time, UTC+00:00)  #    Comments [4] -
<2017 June>
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Dan Miser
Sign In
Total Posts: 388
This Year: 0
This Month: 0
This Week: 0
Comments: 630
Pick a theme:
All Content © 2017, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)