[MonoRail] Controller.RenderMailMessage(string, string, IDictionary<string, object>) Bug

Skip to first unread message

Daniel Hölbling

Jul 17, 2009, 7:04:26 PM7/17/09
to castle-pro...@googlegroups.com
Hello there,

I believe I have just found a tiny bug in the Controller.RenderMailMessage overload that takes a IDictionary<string, object> (Line 1427).
The overload is simply passing on the data supplied to the EmailTemplateService, yet since no implicit conversion between IDictionary<string, object> to IDictionary exists it will falsly call the 

public Message RenderMailMessage(string templateName, string layoutName, object parameters)

instead of the 

public Message RenderMailMessage(string templateName, string layoutName, IDictionary parameters)

method. Thus causing the ReflectionBasedDictionaryAdapter to throw an TargetParameterCountException.

I know I should try writing a testcase for this, but I'm still having trouble making MonoRail compile inside my Visual Studio or to make the tests compile and run through nant.

Anyway, the problem goes away by casting the generic IDictionary to a non-generic one. The right overload gets called and it then works.
Sorry I can't write a test right now.

Btw, this is how my build keeps breaking:

[echo] Running tests in 'Castle.Core.Tests'
[exec] Assembly not found: C:\Users\Daniel\Documents\open source\castle-trunk\build\net-3.5\debug\source\castle-trunk\build\net-3.5\debug\test-results\Castle.Core.Tests.dll-results.xml

greetings, Daniel Hölbling

Jonathon Rossi

Jul 17, 2009, 11:10:15 PM7/17/09
to castle-pro...@googlegroups.com
It may be breaking because of the space in the path name.
Reply all
Reply to author
0 new messages