J
James
Hi guys
Do you ever get the exception in Managed C++? How can I know which file or
dll is missed?
Do you ever get the exception in Managed C++? How can I know which file or
dll is missed?
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
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?
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?