Click here to Skip to main content
12,450,101 members (51,693 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

3.7K views
1 bookmarked
Posted

FileLoadException in InitializeComponent in production PC

, 15 Jul 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
FileLoadException in InitializeComponent.

Introduction 

Have you ever created a project that runs perfectly (yea right!) in your pc but when you deploy it at the production pc it crashes before the first window appear? In most of the cases windows will prompt you to send the error to Microsoft and if you press the link 'What data does this error report contain?' you will see the exception that causes the problem. If this is a FileNotFoundException then the problem is that you haven't shipped every assembly your application needs or you have shipped the wrong version.

Assembly Binding Log Viewer 

Most fortunately Microsoft have created a tool that can help us to trace down what assembly is causing the problem. This tool is called FUSLOGVW.exe and you can find it in your development environment under the 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin' folder. You may copy this file to the production environment and run it. If it fails to load then try to copy flogvwrc.dll from the 'Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\' folder (I didn't need this DLL in Windows Embedded).

Settings 

Before you can use it you have to set the Log settings. Press the settings button from the right list and

  • check 'Enable custom log path'
  • set a path at the TextBox, e.g., 'C:\TEMP
  • select the radiobutton 'Log all binds to disk' 

How to use it 

Now you can run your application and then press 'refresh' at Fuslogvw. You will see a list of all bindings your application uses. The first item is the problematic assembly, it's the last tried loading assembly and the root of the problem. Try to solve this bad reference ether by coping the correct assembly to the production PC or by referencing the correct assembly from your code.

If the problem persist then follow the above steps to see the rest problematic assemblies. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Menelaos Vergis
Software Developer menelabs
Greece Greece
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160826.1 | Last Updated 15 Jul 2013
Article Copyright 2013 by Menelaos Vergis
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid