Why is ccrewrite.exe not doing anything from the command line?

前端 未结 1 1118
夕颜
夕颜 2020-12-16 10:02

I\'ve got Code Contracts working fine from inside Visual Studio 2010, but I can\'t get ccrewrite.exe to do anything useful from the command line. Here\'s a samp

相关标签:
1条回答
  • 2020-12-16 10:37

    Okay, this has been answered in the MSDN forum. For once, it wasn't really me being entirely stupid - it's something that could really do with a warning.

    Read the forum post for full details, but the basic problem is that ccrewrite couldn't find the contract classes: it was looking in the .NET 3.5 CLR version of mscorlib instead of the .NET 4.0 one.

    This can be fixed by explicitly listing the path to the relevant assembly:

    > ccrewrite /o:rewrittendummy.exe dummy.exe 
      /libpaths:%SystemRoot%\Microsoft.Net\Framework\v4.0.20506
    
    0 讨论(0)
提交回复
热议问题