Jan 16

Deploying a .NET application using ClickOnce previously led to application crashing after installation with Microsoft’s error reporting wizard including exception code 0xE0434F4D in reported data. This crash appeared early on every invocation.

Googling the numeric code primarily leads to trouble with Windows Installer. As I was trying to deploy a .NET 2.0 application utilizing ODBC driver for writing Excel stylesheets with Visual C# 2008 Express Edition I expected causes in that constellation of using outdated framework with an uptodate IDE.

It took some time to start my recent Visual Studio 2005 Standard IDE to debug the crash on a client pointing me to trouble with resource management. Finally all I had to do was removing my custom icon resources from any form …  there is something wrong, but since icons aren’t required for functionality I’ll put this on a far future todo list …

Update on February 6th 2009:

A few days after posting that I found a solution to that problem, but missed to post it here until now. In Visual C# 2008, at least in Express Edition, I was used to open a form in Designer and edit its properties using related view providing all properties in a table. The property “Icon” on a form, for example, is featuring to instantly import an icon from file on that spot and that’s what I was doing before not encountering any problems as long as  running the app on the same machine I was developing on. Now I changed to import all my icons into the project’s resource file first and attach them to my forms etc. manually in code.

There is a separate “Resource Designer” available after clicking on Resource.resx found subordinated to the “Properties” node under your project’s node in Project Explorer view. That designer is managing icons among other sorts of data. After importing your icons there you need to load and attach each of them in source manually. I did it in constructor of my form’s class after call to method InitializeComponents, e.g.

Icon = MyProjectName.Properties.Resources.iconName;

Obey the names used in that line and adjust them according to your project’s context: “MyProjectName” is exactly the name of my project/package as found in Project Explorer. Next there is “Properties” meant literally, so keep it as it is here. “Resources” selects one of the resource files (w/o extension .resx) found under Properties in Project Explorer and Resources is the default, so keep it as well. Finally “iconName” is the name assigned to your icon in Resource Designer on importing.

My application is now perfectly running under Windows 2000, XP and Vista without any hassle …

Comments are closed.

preload preload preload