Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies node fails when ReferenceOutputAssembly="False" on ProjectReference #2653

Closed
danroth27 opened this issue Jul 24, 2017 · 24 comments
Assignees
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references Resolution-Duplicate The bug is a duplicate of another bug in this or another repo.
Milestone

Comments

@danroth27
Copy link
Member

danroth27 commented Jul 24, 2017

When I open https://github.com/aspnet/Blazor-Hackathon in VS I get a warning in the solution explorer for the project references for samples/ClientServerApp/ClientServerApp.Server. The dotnet-blazor reference has a warning icon, but there is no warning description in the VS error list.

@danroth27
Copy link
Member Author

image
image

@danroth27
Copy link
Member Author

@srivatsn

@srivatsn srivatsn added the Bug label Jul 24, 2017
@srivatsn srivatsn added this to the 15.3 milestone Jul 24, 2017
@srivatsn
Copy link
Contributor

@natidea can you take a look at how widespread is this?

@abpiskunov
Copy link
Contributor

And what is under dotnet-blazor project? It could be either not compatible with ClientServerApp target framework or has some broken dependencies ...

@srivatsn srivatsn modified the milestones: 15.5, 15.3 Jul 24, 2017
@danroth27
Copy link
Member Author

The repo is public - just clone and take a look

@danroth27
Copy link
Member Author

image

@danroth27
Copy link
Member Author

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Library</OutputType>
    <TargetFramework>netstandard1.3</TargetFramework>
    <RootNamespace>corlib</RootNamespace>
    <AssemblyName>corlib</AssemblyName>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
    <RuntimeMetadataVersion>0</RuntimeMetadataVersion> <!-- Not sure what this affects, but there's a warning if you don't have some value -->
  </PropertyGroup>

</Project>

@abpiskunov
Copy link
Contributor

ClientServerApp.Server has target netcoreapp2.0 and references netstandard1.3 project which seems to be supported https://docs.microsoft.com/en-us/dotnet/standard/net-standard . So warning icon might appear because we use shipped in VS nuget API to check compatibility and need to see what Nuget returns there to start with...

@morrisjoe
Copy link

morrisjoe commented Jul 27, 2017

@danroth27 @srivatsn @natidea

This also happens for this simple scenario....

  1. File->New->Web .NET Core 2.0 projects
  2. Add a MSTest Core 2.0 unit Test project to the sln
  3. Add a P2P Ref from 2 to 1

@morrisjoe
Copy link

@danroth27 @srivatsn @natidea

Note: Even though Dependencies/Projects shows yellow bang, Intellisense is working for the public classes coming in from the project reference

@natidea
Copy link
Contributor

natidea commented Jul 27, 2017

In the case of @morrisjoe I see a NuGet restore failed and the log file contains package downgrade errors:

    {
      "code": "NU1605",
      "level": "Error",
      "message": "Detected package downgrade: System.Net.Primitives from 4.3.0 to 4.0.11. Reference the package directly from the project to select a different version. \r\n UnitTestProject1 (>= 1.0.0) -> WebApplication1 (>= 1.0.0) -> Microsoft.VisualStudio.Web.BrowserLink (>= 1.1.2) -> Microsoft.AspNetCore.Hosting.Abstractions (>= 1.1.2) -> NETStandard.Library (>= 1.6.1) -> System.Net.Primitives (>= 4.3.0) \r\n UnitTestProject1 (>= 1.0.0) -> WebApplication1 (>= 1.0.0) -> Microsoft.VisualStudio.Web.BrowserLink (>= 1.1.2) -> System.Net.Primitives (>= 4.0.11)",
      "libraryId": "System.Net.Primitives",
      "targetGraphs": [
        ".NETCoreApp,Version=v2.0"
      ]
    },

Because of #2436 these diagnostics are not showing up.

@johncollinson2001
Copy link

Hi,

I get the same issue:-

  • .netcore2.0 asp.net project
  • mstest unit testing project which references it
  • warning icon on the referenced project within the the unit testing project
  • tests run fine is Visual Studio
  • nuget restore fails in the CI build in VSTS

Please help!

John

@natidea
Copy link
Contributor

natidea commented Sep 21, 2017

@johncollinson2001 what specific errors are you getting in your CI build? If it is failing because of package downgrade errors (NU1605), you could try upgrading to the latest release, or changing the WarnAsError/NoWarn settings in your project.

@johncollinson2001
Copy link

@natidea hi, many thanks for your help.

On my "dotnet restore" task, I'm getting:

error NU1100: Unable to resolve 'Microsoft.NET.Test.Sdk (>= 15.3.0)' for '.NETCoreApp,Version=v2.0'
error NU1100: Unable to resolve 'MSTest.TestAdapter (>= 1.1.18)' for '.NETCoreApp,Version=v2.0'
error NU1100: Unable to resolve 'MSTest.TestFramework (>= 1.1.18)' for '.NETCoreApp,Version=v2.0'

@natidea
Copy link
Contributor

natidea commented Sep 21, 2017

@johncollinson2001 some things you can check:

  • what version of dotnet are you running (dotnet --info) and what SDK is located under C:\Program Files\dotnet\sdk\
  • are the missing packages in any of your NuGet caches (e.g %USERPROFILE%.nuget\packages)
  • you could try clearing these caches
  • could you also upload a copy of the project.assets.json file associated with the failing project

@natidea natidea modified the milestones: 15.5, 15.6 Oct 2, 2017
@Pilchie Pilchie added Area-New-Project-System Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references labels Dec 22, 2017
@Pilchie Pilchie modified the milestones: 15.6, 15.7 Jan 24, 2018
@Pilchie Pilchie assigned etbyrd and unassigned natidea Mar 30, 2018
@Pilchie Pilchie modified the milestones: 15.7, 15.8 Mar 30, 2018
@drewnoakes
Copy link
Member

Verified this still occurs in d16.0.

Reproswith aspnet/Blazor-Hackathon@8258a43. You'll probably need to update the SDK version in global.json. I used 2.1.600-preview-009497 and the solution built successfully.

  • ClientServerApp.Server.csproj is netcoreapp2.0 and references project...
  • Blazor.Host.csproj (dotnet-blazor) which is netcoreapp2.0 and references project...
  • corlib.csproj which is netstandard1.3

The issue can be isolated between the last two projects. The P2P reference on corlib is flagged as unresolved, yet the Dependencies node of corlib is empty and does not show any warning.

image

@drewnoakes
Copy link
Member

Adding a reference to corlib makes the warning go away on the P2P ref in Blazor.Host.

@drewnoakes
Copy link
Member

We are not seeing a ResolvedProjectReference for corlib.csproj:

image

The lower red box shows ProjectReference changes received via evaluation. These are considered unresolved.

The upper red box shows ResolvedProjectReference changes received via design-time builds. These are considered resolved.

corlib.csproj does not appear in the list of resolved project references, therefore we never set the 'resolved' state of corlib.csproj to true.

@davkean
Copy link
Member

davkean commented Feb 20, 2019

@drewnoakes Those are the resolved paths, we match resolved paths -> evaluation equivalent via the OriginalItemSpec metadata, what does it say?

@drewnoakes
Copy link
Member

@davkean the OriginalItemSpec values all match the DLL names. There's no mention of corlib.csproj anywhere in the ResolvedProjectReference data.

@davkean
Copy link
Member

davkean commented Feb 21, 2019

We'd need to fall back to design-time build logs to figure out why its not being resolved. Very likely the project is missing core targets, or targets that are returning the wrong answers.

@davkean
Copy link
Member

davkean commented Feb 21, 2019

Or maybe not the project looks normal, but I'd still look design-time builds logs.

@jjmew jjmew self-assigned this Sep 19, 2019
@etbyrd etbyrd removed their assignment Nov 11, 2019
@jjmew jjmew assigned drewnoakes and unassigned jjmew Feb 14, 2020
@jjmew jjmew added the Triage-Investigate Reviewed and investigation needed by dev team label Feb 14, 2020
@jjmew jjmew added this to the Backlog milestone Feb 14, 2020
@drewnoakes
Copy link
Member

Minimal repro for this:

  1. Create two projects
  2. Add a ProjectReference from one to the other
  3. Add ReferenceOutputAssembly="False" to that ProjectReference item

This causes the item to appear in evaluation but not in the DTB, which is currently treated as indicating the project is unresolved.

@drewnoakes drewnoakes changed the title Warning in solution explorer without any explanation text Dependencies node fails when ReferenceOutputAssembly="False" on ProjectReference Apr 30, 2020
@drewnoakes drewnoakes removed the Triage-Investigate Reviewed and investigation needed by dev team label Apr 30, 2020
@drewnoakes
Copy link
Member

Duplicate of #2928.

@drewnoakes drewnoakes added the Resolution-Duplicate The bug is a duplicate of another bug in this or another repo. label Apr 30, 2020
@drewnoakes drewnoakes removed the Bug label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Dependency-Node "Dependencies" node in Solution Explorer that display project, binary & package references Resolution-Duplicate The bug is a duplicate of another bug in this or another repo.
Projects
None yet
Development

No branches or pull requests