Unhandled Exception: System.IO.FileNotFoundException: File or assembly name xx or one of its depende

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hi guys

Do you ever get the exception in Managed C++? How can I know which file or
dll is missed?
 
James,

Have you checked the FileName property of the FileNotFoundException that
is thrown?
 
This is a demonstrate

myc++.lib is my API library, which using /delayload:avrt.dll to compile.
When I using "cl /clr /LD xxx.cpp /link /delayload:avrt.dll myc++.lib"
to compile the xxx.dll, test3.exe will work abnormal. But I remove
/delayload:avrt.dll, test3 will throw FileNotFoundException exception
cl /clr /LD xxx.Definition.cpp // the file defines the global enum and
struct value type
cl /clr /LD xxx.cpp /link myc++.lib // xxx.cpp using xxx.Definition.dll and
using functions from myc++.lib
csc test.cs /reference:xxx.Definition.dll /reference:xxx.dll
test.exe

Unhandled Exception: System.IO.FileNotFoundException: File or assembly name
xxx, or one of its dependencies, was not found.
File name: "xxx"
at MyClass.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = xxx, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null (Fully-specified)
LOG: Appbase = D:\tmp\C#Test\Test2\
LOG: Initial PrivatePath = NULL
Calling assembly : Test3, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.

===

LOG: Application configuration file does not exist.
LOG: Policy not being applied to reference at this time (private, custom,
partia
l, or location-based assembly bind).
LOG: Post-policy reference: xxx, Version=0.0.0.0, Culture=neutr
al, PublicKeyToken=null
LOG: Attempting download of new URL file:///D:/tmp/C#Test/Test2/xxx.DLL.

Nicholas Paldino said:
James,

Have you checked the FileName property of the FileNotFoundException
that is thrown?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

James said:
Hi guys

Do you ever get the exception in Managed C++? How can I know which file
or dll is missed?
 
That means that "avrt.dll" is not found when loading xxx.dll (a dependent of
your myc++.dll), make sure both are in your path or in the same directory.

Note that you better post C++ questions to the vc NG
(microsoft.public.dotnet.languages.vc)
Willy.


James said:
This is a demonstrate

myc++.lib is my API library, which using /delayload:avrt.dll to compile.
When I using "cl /clr /LD xxx.cpp /link /delayload:avrt.dll myc++.lib"
to compile the xxx.dll, test3.exe will work abnormal. But I remove
/delayload:avrt.dll, test3 will throw FileNotFoundException exception
cl /clr /LD xxx.Definition.cpp // the file defines the global enum
and struct value type
cl /clr /LD xxx.cpp /link myc++.lib // xxx.cpp using xxx.Definition.dll
and using functions from myc++.lib
csc test.cs /reference:xxx.Definition.dll /reference:xxx.dll
test.exe

Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name xxx, or one of its dependencies, was not found.
File name: "xxx"
at MyClass.Main(String[] args)

=== Pre-bind state information ===
LOG: DisplayName = xxx, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null (Fully-specified)
LOG: Appbase = D:\tmp\C#Test\Test2\
LOG: Initial PrivatePath = NULL
Calling assembly : Test3, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.

===

LOG: Application configuration file does not exist.
LOG: Policy not being applied to reference at this time (private, custom,
partia
l, or location-based assembly bind).
LOG: Post-policy reference: xxx, Version=0.0.0.0, Culture=neutr
al, PublicKeyToken=null
LOG: Attempting download of new URL file:///D:/tmp/C#Test/Test2/xxx.DLL.

Nicholas Paldino said:
James,

Have you checked the FileName property of the FileNotFoundException
that is thrown?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

James said:
Hi guys

Do you ever get the exception in Managed C++? How can I know which file
or dll is missed?
 
Back
Top