Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts

Oct 13, 2011

WPF Application Crashes in Windows XP (System.IO.FileFormatException)

Background

Windows XP users are keep complaining me about  crashes of WPF application as soon I released it.  I was wandered, why all Windows 7 users don’t have that. My team mate did couple of enhancements plus adding new application’s window icon. The error message they receive is (crashing message !),

clip_image002[4]

Problem

Since everything working perfectly on Windows 7, something wrong with XP to what we did lastly. That is replacing the icon. But I have no proof for that, but  got a clue from the following screen.

image

Hm…., I change the icon to a very classic one and try it. WOW, it is working fine in XP. Now I want to find out what is the different between this icon and the my icon. I found that my icon containing additional two image types (256x256, 32bit,PNG), which you can be seen from the Visual Studio Icon editor.

Solution

I removed these two image types from the icon file using Visual Studio Icon Editor, added to the application and  it’s work fine.

To justify the situation, I found this (accessed on 10/13/2011 4:21 PM + GMT 5.30) URL and extracted bellow comment.

Make sure the icon has max size 64x64 pixels.
It can still be 32 bit (using alpha channel).

Mar 13, 2009

Application File Not Valid in XBAP

When you see this error in XBAP application, which means you changed application manifest file from outside. To resolve this
we can use .net tool, which comes with .net SDK, called mage.exe or mageui.exe. More about mage.exe
Frequently used commands to resolve this is mage.exe -u and mage.exe -cc.
Actually this really happened to me, for one user, problem was remain even use mage.exe until he re-install .net runtime.

Dec 8, 2008

Can XBAP run under full-trust mode

A WPF Application can developed to run as standalone or browser based application(XBAP).
In XBAP version there are limitations, like accessing network, SQL operation, file IO operations etc. Because XBAP, by default, run under Partial Trust mode.
You can switch on XBAP to a Full Trust mode anyway. But there are some limitations in terms of deployment.
Full trust XBAP application will only run in local machine as we expected. Even if we set XBAP as Full Trust, it will failed to load in intranet or Internet zone.



Figure 1: When deploy under full trust mode on remote location.

To run under full trust, we want to do one of the followings,
  1. Install XBAP to the local machine (deploy as .msi file).

  2. Sign the XBAP using a trust certificate and install that certificate to the client machine using cermgr.exe

  3. Authorise application URI to be trusted using caspol.exe or .NET 2.0 configuration wizard.

First one is very straightforward but, all things have to done at each client machine. If you really want to enable full trust, develop as WPF standalone application.

MEC: How to Set Message Counter for EDI Message

When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we ...