0
我試圖測試負載所需的所有的.dll的C++ - CLI程序,以確保沒有丟失,但看上去像一個簡單的方法來做到這一點似乎不工作:如何測試.net程序所需的所有.dll文件是否可用?
// First make sure we have all the .dlls we need
Assembly^ assembly = Assembly::GetEntryAssembly();
array<System::Reflection::AssemblyName^>^ referencedAssemblies = assembly->GetReferencedAssemblies();
for each(System::Reflection::AssemblyName^ referencedAssemblyName in referencedAssemblies)
{
String^ strName = referencedAssemblyName->Name;
assembly->Load(strName);
}
...給了我一個異常,說:Could not load file or assembly 'System' or one of its dependencies. The system cannot find the file specified.