0

I have a simple Test project where a CodedUITestMethod is created. The test method simply clicks the Windows Start button in the taskbar. The method is generated by the Coded UI Test Builder tool from Visual Studio 2010 Ultimate.

Then, I go to project's Properties page, Code Contracts tab. Check the Perform Runtime Contract Checking check box. Change the value of Contract Reference Assembly combo box to "Build".

Now I hit F6 to build the project and receive the 2 errors: Reading assembly 'Microsoft.VisualStudio.TestTools.UITesting' resulted in errors.

C:\Program Files (x86)\Microsoft\Contracts\MsBuild\v4.0\Microsoft.CodeContracts.targets (240,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft\Contracts\Bin\ ccrewrite" "@CodedUITest_Contract2ccrewrite.rsp"" exited with code -1.

I have uploaded my project zip file to my codeplex project

Could someone download the project and see if they can reproduce the compile error? Thanks.

Jacob
  • 127
  • 1
  • 2
  • 9
  • Similar: http://stackoverflow.com/q/5610426/60761 – H H Jul 21 '11 at 21:15
  • Since it's a simple project, can you post the parts with the Contracts (in context) ? – H H Jul 21 '11 at 21:17
  • And sorry but -1 because when I took the trouble to browse the code on Plex I couldn't find any Contract calls. – H H Jul 21 '11 at 21:22
  • @Henk I deliberately post the project without the contracts. The project won't compile without any use of contracts. Could you reproduce the compile error? – Jacob Jul 21 '11 at 22:58

1 Answers1

1

The problem is solved. It appears that Microsoft.VisualStudio.TestTools.UITesting.dll references another dll that is not added into the project.

Add Microsoft.VisualStudio.TestTools.UITest.Playback.dll in the folder C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\ solves the issue.

Thanks to David K Allen who answered the question on the msdn forum.

Jacob
  • 127
  • 1
  • 2
  • 9