-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DLL is not valid PE-COFF file when opening a StaticLibrary #279
Comments
The error you're encountering suggests that you're trying to open a file that was built as a Static Library (typically with the .lib extension) instead of a Dynamic Link Library (DLL, with the .dll extension), and tools like depends.exe or Dependency Walker are expecting a valid Portable Executable (PE) file in the form of a DLL or EXE. |
Reason for the Error: |
Change the Project Configuration: Ensure that you're building the project as a Dynamic Link Library (DLL) and not as a Static Library. To do this: After rebuilding the project, ensure that the output is a .dll file. You should now be able to open the .dll file in Dependency Walker without the PE-COFF error. If you're using MSBuild directly (without Visual Studio), ensure your .csproj or .vcxproj is set to create a DLL. You can verify this in the project file: DynamicLibrary |
I build a DLL using
msbuild
and StaticLibrary configuration type. However when I try to open it in dependencies I get this error:Invalid PE
xxx.dll is not a valid PE-COFF file
OK
How can I fix this? The old depends.exe also gives an error.
The text was updated successfully, but these errors were encountered: