Sunday, August 28, 2011

System.BadImageFormatException: Could not load file or assembly <assembly> or one of its dependencies. An attempt was made to load a program with an incorrect format.

I stumbled on this issue today. I have two projects – one that was built for x64, and another one, a test project – built for x86. The test project has a project reference to the library. When I try to execute any of the unit tests, I’m getting the following error:

System.BadImageFormatException: Could not load file or assembly 'assembly name here, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I searched online and found the following article, which opened my eyes how to fix the issue:

http://support.microsoft.com/kb/967163

It’s clear what is the issue – x86 assembly is trying to access x64 assembly. The question is how to solve that issue. The answer is – set the “Platform Target” setting in the x64 assembly project config to “Any CPU”:

image

Monday, May 16, 2011

Fiddler: AutoTruncate setting in the response view

Today I found out about this setting in Fiddler. I’m used to see the raw HTTP response in Fiddler. I use the search feature, which comes very handy when you have a large response in size:

image

When I was searching for “moviesfe”, I noticed that I can’t find what I’m looking for. To note, I’m in “raw” response viewer format. However, when I switch to “TextView” and again type “moviesfe” in the search field, it just finds the data. For the same response. Somehow it doesn’t make sense – you cannot find a string in the Raw response, but when you switch to a viewer (more specifically TextView), the search term is found!

image

I looked closely at the Raw window and noticed the following message:

image

And that hinted what the problem can be. In Raw view, the text was just truncated, hence when you search for “moviesfe”, Fiddler cannot find the string. However, in TextView, this doesn’t happen since the text isn’t truncated. In order to disable text trancation in Raw view, you just need to right click in the view and disable “AutoTruncate” as shown:

image

Sunday, May 08, 2011

Resolving OneNote conflicts with Windows Phone 7

I’m a using OneNote quite a bit on my Samsung Focus (Windows Phone 7 OS). However, recently I started getting on the error message while opening up OneNote on the phone

“Conflicts occurred while syncing. Although you might not see all the changes on this page, your revisions will be saved. Use OneNote on your computer to resolve the conflicts”.

So I started up OneNote but I needed to have the location of the OneNote file which my Samsung loads from SkyDrive. In order to get the file path, you need to go to http://windowsphone.live.com/ and you will see on your right side a section “ONENOTE”:

image

You click on the “NOTES” link from above and Microsoft Web OneNote app will open up your notes in the Web browser. However, in order to resolve the conflicts you will need to open it up in the desktop version of OneNote. To do this, you click on the “Open in OneNote” button on the ribbon:

image

When you open up the OneNote with the conflicts, you will see the following message on the top:

image

Also, on the right side, where is the list of app OneNote pages, you will see the yellow icon with the blocking arrows, looking like this:

image

Choosing the conflict page, will show you a merged version. However,  if you want to see the version of the page that caused the conflict, you can click on the white item with the date (in the example above, it starts with 5/8/2011). Then, if some information was left off, you can easily copy it over to the merged version.

Finally, when you’re done with the conflict page, you can right click on it and you will see the following menu, from where you can remove the conflict:

image