Update odata-cli to target .NET 8 and .NET 10#449
Open
aboryczko wants to merge 1 commit into
Open
Conversation
Author
|
@microsoft-github-policy-service agree |
Author
|
@gathogojr any chance on getting this merged? |
Author
xuzhg
approved these changes
Jun 22, 2026
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFrameworks>net6.0</TargetFrameworks> |
Author
There was a problem hiding this comment.
Your call. Right now .NET 8 and 9 is supported till Nov 10, 2026. I wanted to keep the currently supported LTS versions, but I don't mind making it .NET 10 only
Closed
There was a problem hiding this comment.
Pull request overview
This PR updates the odata-cli .NET tool to avoid startup failures on machines without a .NET 6 SDK by moving off net6.0 and improving MSBuild discovery/registration.
Changes:
- Multi-target
Microsoft.OData.CliandMicrosoft.OData.Cli.Teststonet8.0;net10.0, and bump the CLI package version to0.4.0. - Update MSBuild discovery by bumping
Microsoft.Build.Locatorto1.11.2and guarding registration withIsRegistered. - Fix test host MSBuild setup by adding a module initializer to register MSBuild before tests execute MSBuild APIs, and adjust package assets to avoid MSBuildLocator conflicts (MSBL001).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Microsoft.OData.Cli.Tests/MSBuildRegistration.cs | Adds early MSBuild registration for tests via module initializer. |
| test/Microsoft.OData.Cli.Tests/Microsoft.OData.Cli.Tests.csproj | Multi-targets tests and aligns MSBuild-related package references for locator compatibility. |
| src/Microsoft.OData.Cli/Program.cs | Avoids double MSBuild registration by checking IsRegistered before RegisterDefaults(). |
| src/Microsoft.OData.Cli/Microsoft.OData.Cli.csproj | Multi-targets the CLI, bumps version, updates MSBuild locator, and avoids shipping conflicting runtime MSBuild/NuGet assemblies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| namespace Microsoft.OData.Cli.Tests | ||
| { | ||
| /// <summary> | ||
| /// Registers the MSBuild assemblies from the running .NET SDK before any test exercises the |
Author
|
@gathogojr @WanjohiSammy need just one more "yes" 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #429
Fixes #324
Fixes #428
Fixes #448
odata-clitargetsnet6.0, which is out of support, so it crashes on startup with "No instances of MSBuild could be detected" when no net6 SDK is installed.Multi-targets the CLI (and its tests) to
net8.0;net10.0and bumpsMicrosoft.Build.Locatorto 1.11.2 so it locates the installed SDK's MSBuild. Also fixes the test project to register MSBuild — the part #432 missed that failed CI — and bumps the version to 0.4.0.Tests pass on net8.0 and net10.0, and the packed tool runs
generateon a .NET 8/10-only machine without the crash.