Note that there are some explanatory texts on larger screens.

plurals
  1. POCode Contracts Rewrite Failed - libpaths order
    primarykey
    data
    text
    <p>My Solution/Project builds fine with code contracts turned off for this particular project.</p> <p>When I turn on <em>Perform Runtime Contract Checking</em> on my project, the build fails. The CC rewriter starts to kick up hundreds of messages along the lines of: </p> <p><code>Could not resolve member reference: ....</code></p> <p>It seems this problem is caused by the order of the project references passed to ccrewrite via the <code>libpaths</code> argument. When I pull the build apart, and run it on the command line, and I manually specify the references in a specific order to libpaths, ccrewrite works, and the build completes. </p> <p>eg</p> <p><code>ccrewrite /level:4 /rewrite "/assemblyMode=standard" /throwonfailure /libpaths:"X Y Z" "target.dll" -- fails :(</code></p> <p><code>ccrewrite /level:4 /rewrite "/assemblyMode=standard" /throwonfailure /libpaths:"Z Y X" "target.dll" -- compiles/rewrites :)</code></p> <p>This seems a little odd to me, I'd have thought ccrewrite should be able to handle an arbitrary ordering, especially since the provided 'broken' ordering is the one msbuild is passing along to the Microsoft.CodeContracts.targets file / ccrewrite, but thats an issue for the CC guys. I've also tested this on 3 different machines, with the same result, so its either a ccrewrite issue, or something odd in this specific csproj that ccrewrite doesnt like.</p> <p>What I'm wondering is, can I ensure the specific ordering of my reference projects, that get passed along the chain to the CC targets file? I would have assumed that the build engine would use the order it reads in the project csproj file, under <code>ItemGroup//ProjectReference</code> elements, but its not the case.</p> <p>Any ideas?</p>
    singulars
    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