bug: doesn't build if vs11 is installed and the assembly is signed.

Proposed Answer bug: doesn't build if vs11 is installed and the assembly is signed.

  • quarta-feira, 28 de setembro de 2011 11:34
     
      Contém Código

    i have both vs 2010 and vs11 installed on the same machine. (win7 x64)

    if i create a C# .net 4.0 class library new project in vs2010. add a strong name and enable code contacts i get the following error:

    C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v4.0\Microsoft.CodeContracts.targets(269,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bin\sn.exe" /R "obj\Debug\ClassLibrary1.dll" "test.snk"" exited with code 9009.

    as soon as i disable code contracts it compiles.

    seems like "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bin\sn.exe" is the wrong location. it should rather point to "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sn.exe"

    hope it gets fixed soon, otherwise will have to login to a different vm without vs11 installed.

    thanks

     

Todas as Respostas

  • quarta-feira, 28 de setembro de 2011 14:13
     
     
    I've found that installing VS 10 and VS 11 on the same machine breaks Code Contracts in VS 10. Opening the project properties sometimes causes VS 10 to crash. In other cases I'm able to open the properties, but the Code Contracts tab won't display. To fix it I have to uninstall VS 11 and repair the Code Contracts installation.
    • Sugerido como Resposta FXMC sexta-feira, 23 de março de 2012 18:10
    • Não Sugerido como Resposta FXMC sexta-feira, 23 de março de 2012 18:10
    •  
  • segunda-feira, 17 de outubro de 2011 16:34
     
     
    Just copy the contents of the NETFX 4.0 Tools directory into the parent bin directory. Then it will find sn.exe where it thinks it should be.
  • segunda-feira, 12 de março de 2012 15:26
     
     Resposta Proposta

    Alternatively modify Microsoft.CodeContracts.targets

    change

    <CodeContractsSnExe>"$(CodeContractsSdkPath)Bin\sn.exe"</CodeContractsSnExe>

    to

     <CodeContractsSnExe>"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\sn.exe"</CodeContractsSnExe>

    You may need to use a different path (especially on a 32Bit OS), just check the location of your sdk.

    Remember to restart visual studio, it has a tendancy to cache the file

    • Sugerido como Resposta Marisa C sexta-feira, 30 de março de 2012 13:47
    •  
  • sexta-feira, 23 de março de 2012 18:13
     
     
    it was posted..(above)



    • Sugerido como Resposta FXMC sexta-feira, 23 de março de 2012 18:13
    • Editado FXMC sexta-feira, 23 de março de 2012 18:15 Edited the path
    • Editado FXMC sexta-feira, 23 de março de 2012 18:17
    • Editado FXMC sexta-feira, 23 de março de 2012 18:39
    • Não Sugerido como Resposta FXMC sexta-feira, 23 de março de 2012 18:44
    • Editado FXMC sexta-feira, 23 de março de 2012 18:47
    •  
  • quinta-feira, 13 de setembro de 2012 03:12
    Proprietário
     
     Resposta Proposta
    This has been fixed. Please try the latest version (v1.4.50910.0) and let us know if it doesn't work for you.

    Mike Barnett