-
Notifications
You must be signed in to change notification settings - Fork 151
Warnings and messages from static contract checking don't appear in the VS2015 error list #137
Comments
Grabbed |
I have installed the latest Code Contracts version from https://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970 and still can reproduce this issue. All the Code Contracts messages are printed to the Task List, not to the Error List. Was this fix published to the production? |
@dr-noise This was fixed in RC that was not published to visualstudio gallery. |
@SergeyTeplyakov Sorry if this is a silly question but where can a version with this fix be downloaded? The README of this project still links to https://visualstudiogallery.msdn.microsoft.com/1ec7db13-3363-46c9-851f-1ce455f66970 to download from - but that appears to be an old version that still exhibits this problem. I ask because I'm having the same issue, I think; the Output window shows the CodeContracts output (and includes a warning that I was expecting it to in my simple example) but it doesn't show up in the Error List (VS 2015 Update 2). |
@ProductiveRage There's a |
The vsix link didn't help.. but reinstalling using Contracts.devlab9ts.msi did - working now! :) |
I just installed CodeContracts from scratch in VS2015 (new, recent Visual Studio installation and all) but I still see the warnings appearing inside the Task List window. I tried uninstalling CodeContracts from control panel and reinstalling but I still get the same behavior. Am I missing something? I'm trying to use the latest release build, 1.9.10714.2. |
@julealgon - Ensure that Perform Static Contract Checking is selected from the Code Contracts properties tab (under your project properties). I also had Check in background checked. You can also download the free eBook. It might help (bottom of page 12): Code Contracts Succinctly |
@dirkstrauss I copied the files over to another machine and tested again. The warnings were being written correctly in the Errors Window. I suspect something is wrong in my VS configuration and it could be tied to my login account (some info is now saved on your profile in VS). When I check the extensions pane in Visual Studio, it says I have an out of date version, even though I just installed the latest one from the .msi file: Will take a look to see if I can resolve this as it seems to be a common problem with the CodeContracts installer. |
Installing the pre-release version v.1.10.20606.1-rc2 seems to have fixed the problem. I can still see the same dialog in Visual Studio Extensions pane, but the warnings are appearing correctly now. |
I've been testing the last two releases in VS2015 RC. I've noticed that while warnings and messages from the static analysis are appearing in the Output window, they do not show up in the Error List window. The messages do still appear in the Error List in VS2013, so this seems to be specific to VS2015.
This is easy to repro. Just create a new console app and add the class below. Turn on static contract checking in the project properties, then build. In the output window, you'll see the following warning, but it won't show up in VS2015's error list (it will if you do the same thing in 2013).
Projects\ConsoleApplication2\Program.cs(20,4): warning : CodeContracts: Missing precondition in an externally visible method. Consider adding Contract.Requires(list != null); for parameter validation
The text was updated successfully, but these errors were encountered: