Fatal error CS0009: Metadata file XXX.DLL could not be opened...

Problem

You receive this error when compiling your application:

Fatal error CS0009: Metadata file ‘XXX.dll' could not be opened -- 'There isn't metadata in the memory or stream'

This problem occurs when you have added a third-party DLL to your application and have not properly added it to your compiler’s project file or references list.

Solution

Open your project in Visual Studio .NET.  Make sure the DLL exists and has been properly added to the reference list.  If you are using VBC or CSC to compile your project, check your application’s CompileApplication.rsp file to make sure the DLL is in the /references list like the other DLLs.

Your DLL may not be compatible with .NET or with .NET’s 32-bit mode.  Ensure that your DLL is .NET compatible.

If your project still won’t compile properly, try switching your application’s compiler selection in Iron Speed Designer’s Application Wizard from 'vbc.exe'  or ‘csc.exe’ to Visual Studio .NET or vice versa.  Using Visual Studio .NET will take longer to build than .NET’s VBC or CSC built-in compilers, but Visual Studio .NET will resolve all of the references properly without having to change your application’s CompileApplication.rsp file.

See Also

Part VII:  Troubleshooting Applications

Application Generation and Compilation Error Messages