Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeContracts metadata errors during rewrite
    primarykey
    data
    text
    <p>I'm trying to use code contracts with .NET 3.5 in a large desktop application project, which also have a mixed mode C++ DLL dependency, written in old managed C++ syntax.</p> <p>The real solution consists of at least 20 projects, but lets assume that there is only A, B, C, and D projects, and the mixed mode M project. C depends on A, B and M. A, B and C are all configured to perform runtime checking, and the code rewrite works well. Now I wanted to add some contracts to one of the higher level assemblies to, called D. D depends on all the others, A, B, C and M too. Now the code rewrite fails for D with the following message (I've changed the names):</p> <pre><code>15&gt; Reading assembly 'C' from 'build\debug\C.dll' resulted in errors. 15&gt; ccrewrite : error : Rewrite aborted due to metadata errors. Check output window 15&gt; Input string was not in a correct format. 15&gt; Malformed signature. 15&gt; Index was outside the bounds of the array. 15&gt; Malformed signature. 15&gt; Could not resolve type reference: [M]Name.Space.Class1. 15&gt; Could not resolve type reference: [M].EnumType. 15&gt; Malformed signature. 15&gt; Malformed signature. 15&gt; Could not resolve type reference: [M]Name.Space.Class1. 15&gt; Could not resolve type reference: [M].EnumType. 15&gt; Malformed signature. 15&gt; Malformed signature. 15&gt; Input string was not in a correct format. 15&gt; Malformed signature. 15&gt; Could not resolve type reference: [M]Name.Space.Class1. 15&gt; Could not resolve type reference: [M].EnumType. 15&gt; Malformed signature. 15&gt; Malformed signature. 15&gt; Index was outside the bounds of the array. 15&gt; Malformed signature. </code></pre> <p>Because the messages about M, I think the problem is with the mixed mode C++ DLL. But the C assembly in its own can be code-rewritten succesfully, while it also references M.</p> <p>I also think that the problem doesn't lie directly in the D assembly, because I've tried it with other higher level assemblies in the same solution and they can't be rewritten by the code contracts tool if they reference C.</p> <p>The version I'm using is 1.2.21023.14</p> <p>I've also asked this question in the CodeContracts MSDN forum but haven't received any answers yet, so I thought I'd try here. I'm interested in any workaround or idea related to this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload