January 2012 Entries

CSharpCodeDomClientCodeGenerator encountered a fatal exception

I’ve been battling this now for an hour or so, and as all the reponses I’ve seen online haven’t really helped, I thought I’d whack this up.. The error I got was: The code generator 'Microsoft.ServiceModel.Dom... encountered a fatal exception and could not generate code for project 'TheProject.csproj': Exception has been thrown by the target of an invocation. Now, searching online comes up with loads of things, but the most important one I found was ......

InitParams in Silverlight – passed via MVC

The old skool way of passing InitParams in aspx is well documented, adding a: <param name="initParams" value="<%=InitParams%>" /> which is accessing the public ‘InitParams’ member in the code-behind file, which is inevitably set up via the ‘Page_Init’ handler. All well and good, but not practical in MVC, so… how to do this? (NB. This is just how I’ve done it, it’s not the only solution) There are a few things to change: 1. The Model I’ve created a SilverlightHostModel, it only has one ......