3

Inherited C# win form application - VS .NET 2008.

Project builds with no error.

Navigate to display main dialog in the IDE and error screen displays with the error.

The .dll is in the bin directory. Also, under the "References" tree in project viewer with correct path.

(All supporting files/dlls should be here.)

Any ideas how to fix this?

EDIT 1 started Fuslogvw.exe does not have anything listed. Is there something else I need to do to get this error to display here?

EDIT 2 Running "Dependency Walker" and it comes up with the error:

Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

unable to open 2 windows system32 dlls....

T.T.T.
  • 33,367
  • 47
  • 130
  • 168
  • possible duplicate of [Yet another "could not load file or assembly ... or one of its dependencies. The system cannot find the file specified"](http://stackoverflow.com/questions/1504835/yet-another-could-not-load-file-or-assembly-or-one-of-its-dependencies-the) – 500 - Internal Server Error Mar 06 '12 at 01:17
  • 1
    Use fuslogvw.exe to troubleshoot assembly resolution problems. Works at design time too. – Hans Passant Mar 06 '12 at 01:19
  • @HansPassant: It started up and does not display any error...? – T.T.T. Mar 06 '12 at 01:24
  • possible duplicate of [FileNotFoundException when loading dll](http://stackoverflow.com/questions/9503429/filenotfoundexception-when-loading-dll) - check out Debugging Assembly Loading Failures (http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspx) for details on using fuslogvw. – Alexei Levenkov Mar 06 '12 at 01:26
  • I don't think it is an assembly binding failure... – T.T.T. Mar 06 '12 at 01:35
  • If your code depends on an external DLL, having a reference to it might not be good enough for the IDE. Try adding the full path to your bin dir. under `Project Properties -> Reference Paths` and see if it helps. – AVIDeveloper Mar 06 '12 at 20:47

1 Answers1

2

I decided to answer this question because

  1. I'm looking for the anwser myself and this ranks high in google search yet it is unanswered, and
  2. The "possible duplicate" do not help solving my problem.

OK, here is a recap of my situation, which you can see almost identical to OP:

  • C# project/solution - VS .NET 2013.
  • Project builds with no error.
  • The reference .dlls are in the pre-defined directory.
  • Also, under the "References" tree in project viewer, it shows the correct path.

Yet, Visual Studio complains (at run time):

Could not load file or assembly xxxxxx, Version=x.x.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx or one of its dependencies. The system cannot find the file specified.

I found the solution from here, http://blogs.msdn.com/b/asiatech/archive/2013/01/09/how-to-resolve-the-could-not-load-file-or-assembly-issues-on-windows-azure-web-sites.aspx

I.e., In Visual Studio,

  1. Find the referenced assembly in “Solution Explorer”, e.g., Microsoft.WindowsAzure.StorageClient
  2. In the “Properties” window, set the “Copy Local” to “True”.

answer

It might not be the ideal fix but it solved my problem. If it helps you as well, please +1 (vote up). Thanks.

xpt
  • 20,363
  • 37
  • 127
  • 216
  • Thank you for answering. When reading the question I would have guessed that one of the referenced assemblies was built for 32 bit arch while running on an IIS server/WebApp Instance that (by default) has disabled support for loading 32-bit assemblies. As I understand, both causes result in the symptoms you were experiencing. – DJFliX Feb 28 '16 at 12:04