I installed code contract addon this morning and enabled it on one of the project. My solution has more than 20 projects, but only 5 of them are configured to build, only one of them has code contract check enabled. I triggered the build from the VS an hour an half ago. The build completed in about 5 minutes but most of the VS UI is disabled. I investaged this to find that cccheck.exe is still in progress, taking up over 30% of CPU and about 2G of memory. Into the process for over an hour and half, horrible, isn't it?
Is it normal for code contracts. If yes, then developemnt is almost impossible as you have to build frequently during the development. Is getting rid of code contract is the only solution. I know I can use a differen build configuration for the development withoug CC check enabled, but this will not report me if anything's wrong on the fly?
Any solution to this?, much appricated.
Sorry about that.
Make sure that the options: "analyze in background" and "cache results" are set.
The first avoids VSU to freeze (the analysis is in background) and the 2nd one saves the analysis results in a DB.
The very first time it may take some time to build the database, but all the other times you should reuse it (only the methods that changed are re-analyzed) and so the analysis will be very fast.
FYI: We are working on improving the performance, by re-architecturing the tool so to analyze multiple methods in parallel.
Please do not hesitate to provide feedback.
- Proposed as answer by Francesco LogozzoMicrosoft employee, Owner Friday, August 03, 2012 3:48 AM
Have same problems with a solution..
I tried on VS 2010, and it worked fine, saved the baseline.xml and cached results , now its working ok (i guess it's not doing anything more with the baseline though).
on vs 2012 , it would just stop, and do nothing, meanwhile on vs 2010 , it outputs right away Contract.Ensures , etc.
It starts happening (freezing / ultra slow ....never when to the end , just pskill devenv ... ) when Static checker is put on.
Edit 2 :
The contract dll is created pretty fast, i see it in the folder, just something is locking up outputs for the static checker..
Best solution i ve found :Only way of running in Visual studio 2012 (when there are multiple projects >15 or so )
In symbols add V2012
Assemblyinfo.cs add :
so when you compile using VS 2010, everything will work fine, and still will in VS 2012 ...(though contracts will be off, but you can write them in the editor, just forget about compiling them in VS 2012 , you'd be waiting HOURS)...
Hopefully this is soon sorted ..
- Edited by FXMC Friday, August 10, 2012 12:13 PM More content2.
I just updated to VS 2012 and I noticed that despite having "Check in Background" enabled, the analysis is performed synchronously; project A builds, static analysis begins, static analysis completes, then project B builds, and so on. This is the same behavior that I see when building on the command line. The actual analysis times are still timely and are more or less in line with what I experienced in 2010. However, it is somewhat irritating to have projects locked down for the entire duration of the build + analysis.