S.C. Madsen
S.C. Madsen

Reputation: 5236

Windows Forms app, exception on start-up: Could not load System.Xml

Update: I have tried using fuslogvw.exe to get logs. But what exactly am I looking for? Sadly, the logs are in Danish which is extremely annoying (Apparently someone thought that translating everything literaly into Danish inside error log-messages would be a good idea, but it basically renders Google useless: I have to guess at the original english text to get good hits, grrrr). I Think the translation should go something like: "LOG: Start bind of original image System.Windows.Forms.resources, Version=2.0.0.0, Culture=da-DK, PublicKeyToken=b77a5c561934e089. WRN: No matching original image was found".

I'm quite new to these logs, so suggestions are still velcome.

I have a Windows Forms application, which stores settings using Properties.Settings... I recently downloaded and installed another .Net application. Now all of a sudden my own Windows Forms application throws an exception immediately when starting (where I try to load the settings). The error says something like "file or assembly System.Xml, Version=2.0.0.0, PublicKeyToken= b77a5c561934e089 or one of its dependencies could not be loaded. The module was expected to contain an assemblymanifest".

I have no clue as to where to look for the cause of this error, since the Windows\assembly folder contains System.Xml with correct version and public, key.

Suggestions are most welcome, especially with reference to .Net documentation I should read up on, since I feel this is a big gap in my .Net knowledge.

Thank you!

Upvotes: 0

Views: 1773

Answers (2)

Boris Modylevsky
Boris Modylevsky

Reputation: 3099

Make sure .NET 2.0 is installed on your machine (if only .NET 3.0 is installed it's not enough). Could you please provide more information regarding what framework version your original application is compiled against? Let me know if it helped

Upvotes: 0

Simon P Stevens
Simon P Stevens

Reputation: 27499

This is partly a guess, but it's worth a try.

Take a look in your app.config file. Look for any configuration that references System.XML. If you find any, try removing the version number from the binding. I had a similar kind of issue with multiple versions of the enterprise library.

If that doesn't help you can use the assembly binding log viewer (fuslogvw.exe) to get more information on the binding failure. You have to start it up and enable logging of all bindings (or just failures if you prefer), then make sure your logs are cleared, run your app, hit refresh and look through the binding logs for the System.XML failure. This will provide you with information on where the runtime is looking for the assembly, and why the bind failed.

Upvotes: 2

Related Questions