Open voroninp opened 4 months ago
Without a global.json, build in VS works but dotnet build
fails but if you pin to the 8.0.204 SDK, the VS build fails but the dotnet build
succeeds? What folder are you running dotnet build
in? In VS, what project/solution are you opening?
The logic for how to load the directory.build.props file comes from the common props in msbuild. CC @dotnet/kitten to comment on the best way to get the experience you want.
In preview VS it fails always. In stable version VS it works irrespective of global.json
dotnet build
fails without global.json, but succeeds when pinned to 8.0.204
This is a behavior change caused by https://github.com/NuGet/NuGet.Client/pull/5572.
@JonDouglas called it out as a breaking change in https://github.com/NuGet/Home/issues/11834 but I'm not sure that's documented as such yet. @jeffkl fyi.
@rainersigwald , how do I disable it for the subtree then (tools
solution)?
Directory.Build.props
Directory.Package.props
src
tools
|
- Directory.Build.props
- tools.sln
Explicitly set
<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup>
in the nested Directory.Packages.props
.
Ah, so I need to create it as well. Ok, thanks.
Is there a way to keep it default as false? I have a generated project using openapi generator that doesn't set it to false and every time I generate files I need to modify manually all csproj files :(
I've created empty Directory.Packages.props
to disable CPM at some level.
Describe the bug
I have a repository with multiple
Directory.Packages.props
files. I want to exclude some projects (tools
directory) from central package management. I can build solution in VS Version 17.9.6 (fails with Version 17.10.0 Preview 5.0) without issues, butdotnet build
command fails with this error:It looks like the closest
Directory.Packages.props
file is ignored.To Reproduce
Here is the solution to reproduce the issue (sln file is in
Json.TestLogger directory
): CliBug.zipFurther technical details
dotnet --info
Runtime Environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.300-preview.24203.14\
.NET workloads installed: [android] Installation Source: SDK 8.0.300-preview.24203, VS 17.10.34818.151, VS 17.9.34728.123 Manifest Version: 34.0.95/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.95\WorkloadManifest.json Install Type: FileBased
[ios] Installation Source: SDK 8.0.300-preview.24203, VS 17.10.34818.151, VS 17.9.34728.123 Manifest Version: 17.2.8053/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json Install Type: FileBased
[maccatalyst] Installation Source: SDK 8.0.300-preview.24203, VS 17.10.34818.151, VS 17.9.34728.123 Manifest Version: 17.2.8053/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json Install Type: FileBased
[maui-windows] Installation Source: SDK 8.0.300-preview.24203, VS 17.10.34818.151, VS 17.9.34728.123 Manifest Version: 8.0.7/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.7\WorkloadManifest.json Install Type: FileBased
[wasm-tools] Installation Source: SDK 8.0.300-preview.24203, VS 17.10.34818.151, VS 17.9.34728.123 Manifest Version: 8.0.4/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.4\WorkloadManifest.json Install Type: FileBased
Host: Version: 8.0.4 Architecture: x64 Commit: 2d7eea2529
.NET SDKs installed: 7.0.408 [C:\Program Files\dotnet\sdk] 8.0.204 [C:\Program Files\dotnet\sdk] 8.0.300-preview.24203.14 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download
{ "sdk": { "version": "8.0.204" } }