-
Notifications
You must be signed in to change notification settings - Fork 258
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
Comments
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. |
Can you expand on above? Do you mean that ClassLibrary1.csproj is referenced but not included in the solution? |
From @abpiskunov on August 30, 2017 0:28 yes, correct |
This is NuGet not generating an assets file for this project. I have no idea what we should be doing about this situation. |
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). |
what errors you get from DTE? |
|
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? |
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. |
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 |
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. |
Took a stab at it and the initial POC is NuGet/NuGet.Client#2521 |
I am still getting this problem. In VS2022. If Sln So, in my scenario, where Sln However, adding the following: <Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="Exists('$(SilkSource)')">
<!-- Attempt workaround for https://github.com/NuGet/Home/issues/5820 -->
<Exec Command="dotnet restore" />
</Target> At least allows |
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
The text was updated successfully, but these errors were encountered: