VS Code, Unresolved References.

  • Hi all,

    I just started using VS Code to work with DB projects.  I have a work-in-progress DB, meaning some of the objects are broken.  But, for those that are not broken, when I run

    dotnet build

    I get many unresolved reference errors that have no problem existing on the server or in SSMS.  The first few objects on the list are views, which almost all use table aliases.  Looking through the scripts, all use Schema.Table references.  A few tables do not have red underlines, but most do.  Some of these views also use CTEs, not sure if that makes any difference, though.

    I created this project as new, then added a database reference directly to our Server.DB.  I would like to understand why this happens and what I can do to mitigate or prevent it.  I would show some examples, but that's forbidden.

    I also noticed in the msbuild.log file things like this:

     The "DefaultSdkResolver" resolver attempted to resolve the SDK "Microsoft.Build.Sql/2.1.0".
    Warnings: null
    Errors: MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.Build.Sql" because directory "C:\Program Files\dotnet\sdk\8.0.419\Sdks\Microsoft.Build.Sql\Sdk" did not exist.


    The "Microsoft.DotNet.MSBuildWorkloadSdkResolver" resolver attempted to resolve the SDK "Microsoft.Build.Sql/2.1.0". Warnings: null

    Errors: MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator" because directory "C:\Program Files\dotnet\sdk\8.0.419\Sdks\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk" did not exist.
    The SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator" was successfully resolved by the "Microsoft.DotNet.MSBuildWorkloadSdkResolver" resolver to location "null" and version "null".

    I am not quite sure how to fix those, either.  Could they be contributing to the unresolved SQL reference errors?

    Advice?

    Thanks!

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply