Archive for June, 2012

I ran into this error today when I added some transformations to my web.config to allow for different versions of the config to exist (I’m using one for different nodes on Azure, and local debugging). The problem is, after I did this and redeployed, I received the above error.

Turns out, it has to do with a processor setting that gets populated when adding transformations, and is easily fixed. You’ll need to go into the project file for each of your webroles, edit it with a text editor, and remove all platformtarget entries.

Easiest way to do this is to do a replace the following: “<PlatformTarget>AnyCPU</PlatformTarget>” with nothing. I ended up having to remove four total. Once I redeployed after this change, the project worked appropriately

Recently I needed to add a datacontract to a service of mine, that didn’t have a method associated. It seemed pretty straight forward, but ended up being very simple, but I could find little to no documentation about adding an additional data contract with no dependencies. Why would you want to do this? Well, I was in need for sharing the logical structure of the object down to code that would end up pushing out xml objects in the required format for my wcf service.

Seems you cannot just add a datacontract, you actually have to have some method that utilizes the datacontract for your wcf service to see it as a required dependency, and therefore include it at runtime. I went ahead and just created a simple method that would return a list of the specified type, and presto, we have a datacontract.

It seems there’s quite a few people who’ve run into a similar situation, but I couldn’t find much information regarding this in all the threads I searched, so I figured I’d share it here.

More recently, I’ve been writing a lot of client side code for some interfaces on a new platform I’ve been designing. I have discovered a new toolkit that allows data binding of elements and providing a more rich user interaction through observable objects. One issue I ran into was the ability to to bind element id’s on a foreach loop of data elements. I looked around and didn’t see much about the issue, but thought others may run into the desire to add this element data to lists as well.

After you data-bind your particular array of items, or whatever element you want to use, the easiest way to get this data onto your DOM is to use the attr selector within your internal data.

For example:

   1: <tbody data-bind="foreach: items">

   2:             <tr data-bind="attr: {id: ItemId}" >

   3:                 <!-- item template goes here -->

   4:             </tr>

   5:         </tbody>


As you can see, through this binding attribute, you can bind almost any element to values within the DOM, which can be very helpful in the development process of advanced client interfaces.