-
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
dotnet Restore (& therefore msbuild /t:restore) skips projects with an explicit solution project dependency #4578
Comments
Also remove unused configurations.
Thanks for the repro @natemcmaster Restore reads the solution metaproj for all project references. For this solution I see it puts the reference to NuGetPackageVerifier in an external metaproj file and references it. <ProjectReference Include="C:\src\repros\BuildTools\src\NuGetPackageVerifier\NuGetPackageVerifier.csproj.metaproj">
<ToolsVersion>15.0</ToolsVersion>
<SkipNonexistentProjects>Build</SkipNonexistentProjects>
<AdditionalProperties>Configuration=Debug; Platform=Any CPU</AdditionalProperties>
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectReference> I believe restore has had issues with these in the past and ignores them because they don't actually exist when it tries to resolve them. @rainersigwald what is the best way to get the set of top level projects from a solution file? Would it work to strip the .metaproj extension from these paths and continue walking them? |
That's not a good way but I do think it might be the best way. References are added to the metaproj by this code which only adds either a direct reference or, if there's something special about the project, a reference to its metaproj. Filed dotnet/msbuild#1694 to consider creating an item with the contents you expect (definitely not for RTW though). Hopefully no user has a real file on disk ending with |
Got another email complaint about this today from an external customer via @Pilchie |
I also just ran into this: #4845 |
This change adds a task to modify project references coming from a solution file. When project build order is used the solution file read by restore contains links to .metaproj files instead of the actual projects. The actual project can be found by removing the metaproj extension. Cleaning up _SplitProjectReferencesByFileExistence, the outputs from this are not used since ProjectReference is used direcetly. There is no reason to depend on this external target. Fixes NuGet/Home#4869 Fixes NuGet/Home#4578
* Upgrade to Visual Studio 2017 + csproj tooling * Include workaround for NuGet/Home#4337 (explicitly specify version when restoring NuGet packages) * Work around dotnet/cli-migrate#11 * Upgrade to .NET Core 1.1.x * Remove VersionPrefix from all csproj files * Legacy NuGet restore is no longer needed * Disable CS1701 warning for sample projects * Turns out we actually do need the legacy NuGet restore * Use VS2017 AppVeyor image * Remove project dependencies to work around NuGet/Home#5193 and NuGet/Home#4578 * Use MSBuild 15 on AppVeyor * Enforce .NET Core tools 1.0.0 in global.json * Use newer npm on AppVeyor (as a workaround for https://github.com/dotnet/cli/issues/6561 and dotnet/msbuild#406), and run correct test command
* Upgrade to Visual Studio 2017 + csproj tooling * Include workaround for NuGet/Home#4337 (explicitly specify version when restoring NuGet packages) * Work around dotnet/cli-migrate#11 * Upgrade to .NET Core 1.1.x * Remove VersionPrefix from all csproj files * Legacy NuGet restore is no longer needed * Disable CS1701 warning for sample projects * Turns out we actually do need the legacy NuGet restore * Use VS2017 AppVeyor image * Remove project dependencies to work around NuGet/Home#5193 and NuGet/Home#4578 * Use MSBuild 15 on AppVeyor * Enforce .NET Core tools 1.0.0 in global.json * Use newer npm on AppVeyor (as a workaround for https://github.com/dotnet/cli/issues/6561 and dotnet/msbuild#406), and run correct test command
* Upgrade to Visual Studio 2017 + csproj tooling * Include workaround for NuGet/Home#4337 (explicitly specify version when restoring NuGet packages) * Work around dotnet/cli-migrate#11 * Upgrade to .NET Core 1.1.x * Remove VersionPrefix from all csproj files * Legacy NuGet restore is no longer needed * Disable CS1701 warning for sample projects * Turns out we actually do need the legacy NuGet restore * Use VS2017 AppVeyor image * Remove project dependencies to work around NuGet/Home#5193 and NuGet/Home#4578 * Use MSBuild 15 on AppVeyor * Enforce .NET Core tools 1.0.0 in global.json * Use newer npm on AppVeyor (as a workaround for https://github.com/dotnet/cli/issues/6561 and dotnet/msbuild#406), and run correct test command
Also remove unused configurations.
* Upgrade to Visual Studio 2017 + csproj tooling * Include workaround for NuGet/Home#4337 (explicitly specify version when restoring NuGet packages) * Work around dotnet/cli-migrate#11 * Upgrade to .NET Core 1.1.x * Remove VersionPrefix from all csproj files * Legacy NuGet restore is no longer needed * Disable CS1701 warning for sample projects * Turns out we actually do need the legacy NuGet restore * Use VS2017 AppVeyor image * Remove project dependencies to work around NuGet/Home#5193 and NuGet/Home#4578 * Use MSBuild 15 on AppVeyor * Enforce .NET Core tools 1.0.0 in global.json * Use newer npm on AppVeyor (as a workaround for https://github.com/dotnet/cli/issues/6561 and dotnet/msbuild#406), and run correct test command
Calling "msbuild.exe /t:Restore" on a solution skips a project in my solution.
This project has an explicit project dependency in the solution file.
Repro
Expected
Restores all csproj reference .sln file.
Actual
Skips NugetPackageVerifier.csproj
(see restore log here: https://gist.github.com/natemcmaster/016baf3563e369551d8f4c88cf9dcce0)
Details
msbuild.exe 15.0.26209.0
dotnet.exe 1.0.0-rc4-004771
Right click on solution -> Project Dependencies
Or see the raw BuildTools.sln
cc @emgarten
The text was updated successfully, but these errors were encountered: