I had a C# .NET windows application having C# user interface and all the code behind processing is done by calling C++ dll (C++ class library project) which is added as a reference to the C# project.
However recently when I formatted my computer and again tried to run my project which was backed up, in visual studio 2005 it gave the following exception:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Windows.Forms.dll
Additional information: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
This exception is thrown when I put the following code (for example) in the button click event.
private void button3_Click(object sender, EventArgs e)
{
CyclopiaDll.Class1 cc = new CyclopiaDll.Class1(); // calling dll
cc.clearData();
}
However the exception is actually shown to be thrown in this line even though the form gets loaded without a problem:
Application.Run(new Form1());
I tried building the new project and adding the referenced dll again but I m still getting the exception. This happened to me before also when I tried to run this project in another computer. However after my machine was formatted even I cant even run the application.
Only way I can think of solving this is to recreate the project from the scratch as before. which is time consuming.
Is there a way to avoid this problem so that I can run this project in my computer as well as in another computer ?