Problem with VS 2017 Solution Build (5 projects)

Bob Hill 1 Reputation point
2020-08-24T18:34:17.98+00:00

I have one project in a Visual Studio 2017 solution that will not build and shows multiple errors.

The project is a "Business Layer" class, and each class file in the project must inherit from a similar named class in a separate data layer class library.

A typical error shows "Type 'DeductionDC' is not defined", and the source line where this error occurs is as follows...

Public Class Deduction
Inherits DeductionDC

The DeductionDC class is in the separate data layer class project, and the business layer project references this data classes project.

What's more, when I click on the error and the source file opens in the business layer project, the error goes away and the total number of errors shown goes down. If I continue to double-click on the errors, the errors are eliminated and the total # of errors continue to go down.

Unfortunately, there are 1924 errors, so after I got down to about 1500 remaining, I decided to do a rebuild to make sure that my efforts where working. When I did, the # of errors went back up to 1924, and the errors that I had fixed were once again appearing as errors.

I'm trying to figure out how to deal with this. I have an identical solution in VS2010 and have compared the setups back-and-forth and they appear to be correct. All of the necessary "references" are within the Business Layer project, yet it fails to properly see the DataLayer project.

I have tried cleaning and rebuilding, closing VS, re-opening and then doing a full build, but nothing seems to work. At this point, I'm looking for some guidance on how to correct this.

Thank you!
Bob Hill

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,176 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 31,086 Reputation points Microsoft Vendor
    2020-08-25T04:31:46.233+00:00

    Hello Bob,

    If the solution(projects) you are using in VS 2017 was migrated from VS 2010, you can refer to this document Project migration and upgrade reference for Visual Studio(2017) and check if your solution meets the requirements to migrate.

    Besides, if you try to directly open your solution (in VS 2010) by using VS 2017(back up your solution before performing this action), will the errors appear? Also please try following steps to troubleshoot.

    1. Please try to re-add or reinstall the necessary “references” from VS 2017, for example right-click References or Dependencies node in Solution Explorer and choose Add Reference.
    2. If you use some NuGet packages, you can try to reinstall NuGet Packages by using command like this Update-Package <package_name> -ProjectName MyProject -reinstall in Package Manager Console (Tools > NuGet Package Manager > Package Manager Console).
    3. Please try to reset VS settings by opening Developer Command Prompt for VS 2017 > type devenv /ResetSettings > press Enter to reset VS settings.
    4. Please close all Visual Studio instances and try to rename (or delete) the hidden .vs, bin and obj folders in your solution folder, after that rename (or delete) every subfolders named ComponentModelCache under this directory C:\Users\[user name]\AppData\Local\Microsoft\VisualStudio\15.0_XXXXXX. Build your solution again.
    5. If possible, you can try to use VS 2017 on another machine then build to see if the errors are disappeared.
    6. Please try to repair VS 2017 and update VS 2017 to the latest version(15.9.26).
    7. Please try to create a new solution in VS 2017 and then copy(migrate, add) the contents and resources from old solution to new solution. After that build again.

    In addition, could you share some more information with me, such as build logs, a reproduced simple sample. This will be useful for me to check further.

    Best Regards,
    Tianyu

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.