Answered by:
Background checking doesn't work sometimes

Question
-
I cannot say under which conditions it doesn't work. Most of time it works, but sometimes it just stops working until I exit VS and then load the project in a new instance of VS. The output ends with the following text:
contracts: Service: Schedule static contract analysis.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
Friday, May 22, 2009 10:04 AM
Answers
-
I'm going to close this for now, but please post again if you can repro this so we can fix it if it is still a problem in the latest release.
Cheers, -MaF (Manuel Fahndrich)- Marked as answer by Manuel Fahndrich Monday, October 26, 2009 3:07 PM
Monday, October 26, 2009 3:07 PM
All replies
-
Seems like it stops working if last attempt to compile the project failed for some reason (error in source code, for example).Friday, May 22, 2009 10:33 AM
-
Could be that the static checker takes a long time. We schedule it to run in the background, so if it loops/hangs etc, you might see the above output.
Let me know if you have a repro we can look at.
Cheers, -MaF (Manuel Fahndrich)- Proposed as answer by Manuel Fahndrich Monday, June 8, 2009 11:39 PM
Monday, June 8, 2009 11:39 PM -
Hi Manuel
The static checker is not started at all because task manager shows no CPU activity. Usually the output looks like
contracts: Service: Schedule static contract analysis.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
contracts: Service: Background contract analysis started.
But the last line sometimes missing and in that case background analysis is not performed. I don't know how to repro this because this is unstable. For example, today I closed another solution, opened the solution with contracts and I was not able to make the static checker run in the background until I restarted VS. After that it works (still works).
And I forgot to mention that this is a multiproject solution (2 csproj + 1 wixproj). But the problem occurs even when I explicitly build 1 specific csproj.Tuesday, June 9, 2009 7:14 AM -
Can you try to see if it works when you clear the checkbox that instructs your project to run the static analysis in the background? Maybe we'll get an error then that we can debug.
Cheers, -MaF (Manuel Fahndrich)Friday, June 12, 2009 5:25 AM -
Manuel,
When I switch background checking OFF all works perfectly even without restarting VS.
contracts: Service: Run static contract analysis.
contracts: Service: Validated: 98,5%
contracts: Service: Total methods analyzed 117
contracts: Service: Total time 1:2min. 538ms/method
D:\Projects\Xxxx\SmsQueue\Service\Xxxx.SmsQueue.exe(1,1): message : contracts: Checked 540 assertions: 532 correct 8 unknown
contracts: Service: Static contract analysis done.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========Monday, June 15, 2009 11:53 AM -
Is this still a problem in the new release for you?
Cheers, -MaF (Manuel Fahndrich)Friday, September 18, 2009 12:08 AM -
Hi Manuel,
Yes, it still occurs with the new build (in rare cases).
And when it happens only restarting VS helps to make it work againFriday, September 18, 2009 6:20 AM -
How can we resolve this. Is there a way to get a repro?
Cheers, -MaF (Manuel Fahndrich)Friday, September 18, 2009 3:47 PM -
I cannot describe a reliable scenario to reproduce it. In most cases it works but sometimes it ends up with the message "contracts: Service: Schedule static contract analysis." and nothing more is written to the Output window (no matter how long you wait).Monday, September 21, 2009 7:36 AM
-
I'm going to close this for now, but please post again if you can repro this so we can fix it if it is still a problem in the latest release.
Cheers, -MaF (Manuel Fahndrich)- Marked as answer by Manuel Fahndrich Monday, October 26, 2009 3:07 PM
Monday, October 26, 2009 3:07 PM