| Severity | Error |
| Reported by | PostSharp |
| Message | Invalid metadata in module "<Module>": the column <Table>.<Column> designates the row <Row> of the <TargetTable> table, but this table has <RowCount> rows. |
Cause
The metadata of a .NET assembly is a set of tables. Some columns, such as the MethodList column of the TypeDef table, designate the first of a run of rows in another table: here, the first method of each type. The ECMA-335 standard allows such a column to designate any row of the target table, or the row just after its last one for an empty run.
PostSharp reports PS0281 when it reads a module, either the assembly that it transforms or a referenced assembly, in which such a column designates a row beyond this limit. <Module> is the name of the module, <Table>.<Column> is the offending column, <Row> is the row it designates, and <TargetTable> and <RowCount> are the target table and its number of rows. PostSharp ends the run at the last row of the target table and continues, but the result of the build cannot be trusted.
A compiler does not produce such metadata. The module was usually damaged, or produced or rewritten by a tool with a bug: an obfuscator, an IL rewriter or another post-compiler.
This message requires an assembly with invalid metadata, so no example can show it.
Resolution
- Identify the module from
<Module>. When it is a referenced assembly, check that it is the file that its package or its project produces: delete thebinandobjdirectories and the package from the NuGet cache, then restore and rebuild. - When a tool rewrites the module before PostSharp reads it, such as an obfuscator or another IL rewriter, build without this tool to confirm that it causes the problem, then report the problem to its vendor, or run it after PostSharp.
- When the module is produced by the C# or Visual Basic compiler alone, report the problem to PostSharp support with the module.
See Also
Other Resources