views:

151

answers:

2

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!

+1  A: 

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.

Simon P Stevens
Below is a snippet from the applications .config file. If I understand you correctly, I should delete the Version=2.0.0.0 part?<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="MyApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> </sectionGroup>
S.C. Madsen
No. Leave all of that, none of refers to the System.XML assembly. I suggest you try using fuslogvw.
Simon P Stevens
A: 

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

Boris Modylevsky
I have .NET 2.0, 3.0, 3.5 SP1 installed. How can I check the "condition" of these?Also, How do I check which version my application was compiled against? Is that information "embedded" in the binary .exe?
S.C. Madsen
To check that .NET 2.0 is installed on you machine, run the following command from the command line:dir %WINDIR%\Microsoft.NET\Framework\v2.0.50727To check what .NET framework your application is compiled against, check Project -> Properties -> Application -> Target FrameworkTo check on an existing executable or assembly, open it in Reflector and check the version of referenced mscorlib.dll. This is the version of the Framework.
Boris Modylevsky