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

Support VS 2019 Solution Filter feature. Also supports project not in solution, or unloaded projects. Need to restore complete solution (via CLI or VS) first. #5820

Closed
davkean opened this issue Aug 30, 2017 · 12 comments

Comments

Projects
None yet
5 participants
@davkean
Copy link

commented Aug 30, 2017

From @abpiskunov on August 29, 2017 16:32

I have follwoing solution structure:

ClassLibrary1 (classic net46)
somefolder
ClassLibrary7
\ClassLibrary7 (core net46)

ClassLibrary7 has project reference for ClassLibrary1 in the form that specify Guid:

<ProjectReference Include="..\..\..\ClassLibrary1\ClassLibrary1.csproj"> <Project>{2684d895-d7ce-4b24-a29e-caed2291e2ea}</Project> <Name>ClassLibrary1</Name> </ProjectReference>

Build fails both from VS and from command line saying that

"C:\Users\antonpis\source\repos\ClassLibrary7\ClassLibrary7\ClassLibrary7.csproj" (default target) (1) ->
(ReportAssetsLogMessages target) ->
c:\users\antonpis\source\repos\ClassLibrary7\ClassLibrary7\ClassLibrary7.csproj : error NU1105: Unable to find project information for 'c:\users\antonpis \source\ClassLibrary1\ClassLibrary1.csproj'. The project file may be invalid or missing targets required for restore. [C:\Users\antonpis\source\repos\Class Library7\ClassLibrary7\ClassLibrary7.csproj]

Classic csproj would work in this case (VS however showed a warning but built fine) both in VS and command line (command line did not have warnings)

Copied from original issue: dotnet/project-system#2759

@davkean

This comment has been minimized.

Copy link
Author

commented Aug 30, 2017

From @abpiskunov on August 29, 2017 16:40

Note: removing Guid and Name metadata from ProjectReference would fix that, but imagine users converting tehir projects and see errors when where there should be no error at all... they know that csproj file does exist in that location.

@davkean

This comment has been minimized.

Copy link
Author

commented Aug 30, 2017

Can you expand on above? Do you mean that ClassLibrary1.csproj is referenced but not included in the solution?

@davkean

This comment has been minimized.

Copy link
Author

commented Aug 30, 2017

From @abpiskunov on August 30, 2017 0:28

yes, correct

@davkean

This comment has been minimized.

Copy link
Author

commented Aug 30, 2017

This is NuGet not generating an assets file for this project. I have no idea what we should be doing about this situation.

@emgarten

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2017

The reason NuGet does not generate an assets file is because when reading the project references from DTE there is a failure when trying to get the project details for the dependency project. If the project system fixed this then NuGet would restore the project.

Overall the error message looks correct here. I don't think that NuGet is the right home for this (if it should be fixed).

@abpiskunov

This comment has been minimized.

Copy link

commented Aug 30, 2017

what errors you get from DTE?

@emgarten

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2017

Reference.SourceProject is null or throws an exception when accessing it. Which makes sense since the project system doesn't have the project which is outside of the solution, but this means that NuGet can't restore it since we are working within VS and not shelling out to restore any path found.

@abpiskunov

This comment has been minimized.

Copy link

commented Aug 30, 2017

hm , but you do have full path to csproj file don't you? it is specified in the ProjectReference. Could you do something with that without DTE?

@emgarten

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2017

Not that I know of. NuGet currently doesn't have a way to work with msbuild directly from VS, the project system handles this and for classic projects NuGet works by using an interface to read PackageReferences, and IVSHierarchy/DTE to read properties needed for restore.

@emgarten

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2017

The project system handles reading project files, which is the missing piece here, I think this issue is best tracked here: dotnet/project-system#2759

@jainaashish

This comment has been minimized.

Copy link
Contributor

commented Nov 8, 2018

We met with project system and platform team about this issue, and the current thought is that NuGet can persist unhashed dependency graph of project so that later when the project is unloaded or out of solution, it can still use persisted dependency graph to continue with Restore. So reopening this issue for further tracking.

@jainaashish

This comment has been minimized.

Copy link
Contributor

commented Nov 8, 2018

Took a stab at it and the initial POC is NuGet/NuGet.Client#2521

@jainaashish jainaashish changed the title Core projects fail to build when they reference other projects not included to solution Restore inside Visual Studio fails for projects when they reference other projects not included in solution Dec 19, 2018

@jainaashish jainaashish self-assigned this Dec 20, 2018

@rrelyea rrelyea added Preview2 Preview3 and removed Preview2 labels Jan 11, 2019

@rrelyea rrelyea added Preview3 and removed Preview3 labels Jan 30, 2019

@rrelyea rrelyea changed the title Restore inside Visual Studio fails for projects when they reference other projects not included in solution Enable restore in VS to succeed if a project is not loaded, but has previously been restored Feb 13, 2019

@rrelyea rrelyea changed the title Enable restore in VS to succeed if a project is not loaded, but has previously been restored Enable restore in VS to succeed if a project is not part of solution or is not loaded, but has previously been restored Feb 13, 2019

@rrelyea rrelyea changed the title Enable restore in VS to succeed if a project is not part of solution or is not loaded, but has previously been restored Support VS 2019 Solution Filter feature. Also supports project not in solution, or unloaded projects. Need to restore complete solution (via CLI or VS) first. Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.