简体   繁体   中英

visual studio 2015 not clearing error list after successful build

Often when I am working on a project in Visual Studio 2015 I will be fixing build errors. I will see the errors and then figure out the problem, make changes to the code, save and build again.

The build will be successful as indicated in the build output window.

 ========== Build: 18 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========

But when I look at the error list, the errors are still there.

在此处输入图片说明 Why is this error showing up if the build worked?

Edit:
@MethodMan request the source of the error. It is an actual valid error from within the test project.

    public void GetCustomerStatusInfoReportTest()
    {
        ReportManager target = new ReportManager();
        List<GetCustomerStatusInfoResult> actual;

        int resultCount;
        actual = target.GetCustomerStatusInfoReport(1, DateTime.UtcNow.AddMonths(-3), DateTime.UtcNow, null, null, null, null, null);
        resultCount = actual.Count;
        Assert.IsTrue(resultCount > 0);
    }

I'll post an answer in case anyone else get confused by this.

After many helpful comments, it turns out the error is in a test project that is not a dependency and not getting built. @HansPassant pointed out this is not a build error but a "code analysis error".

I looked it up and a new feature in 2015 is to show Build + IntelliSense errors in this window. I could suppress the error by selecting "Build Only" but I like the new feature now that I understand what is going on and fixed the code.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM