Edit

Share via


MSB3246 diagnostic code

This article describes the MSB3246 error code.

Message text

MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible.

Remarks

This error occurs when MSBuild finds an assembly file, but couldn't open the file to inspect the metadata as a .NET assembly. This could be because the file is corrupted so it's not readable as an assembly, or it isn't actually an assembly file.

See Troubleshoot assembly references to investigate the issue, including identifying the specific file MSBuild was trying to read.

If the assembly is part of an SDK or tool, try reinstalling the SDK or tool.

Is the assembly obfuscated? Check the documentation for the obfuscation tool to determine how to obfuscate an assembly that is used as a reference.

If it's your own assembly, try rebuilding it, and try opening the assembly in an assembly viewer such as ILDasm.exe to see if it loads correctly.

Applies to

All versions of MSBuild