Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/Test.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Copyright>(c) Microsoft Corporation.</Copyright>

<TargetFramework>net9.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<LangVersion>13.0</LangVersion>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
4 changes: 2 additions & 2 deletions test/tools/WebListener/Controllers/GetController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public JsonResult Index()
Hashtable args = new Hashtable();
foreach (var key in Request.Query.Keys)
{
args.Add(key, string.Join(Constants.HeaderSeparator, Request.Query[key]));
args.Add(key, string.Join(Constants.HeaderSeparator, (string)Request.Query[key]));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be fixed in Runtime repository. Is there an issue for the pattern?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please report to Runtime repo the issue?

I see there are:
dotnet/runtime#101261
dotnet/runtime#101499
dotnet/runtime#101457

xtqqczze I suggest to revert to 11.0 lang for the test project so that we can merge and don't wait comments from dotnet team.

Originally posted by Ilya (@iSazonov) in #24617 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet/runtime#101499 is labelled needs-breaking-change-doc-created

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started discussion: dotnet/runtime#110216

@iSazonov Ilya (iSazonov) Dec 10, 2024 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explicitly report (with repro steps) about the issue with cast needed? I guess it is not doc issue, it should be fixed in Runtime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the issue is with Microsoft.Extensions.Primitives.StringValues

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is a breaking change, resolution is by updating code, e.g. dotnet/aspnetcore@7e353a3

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened issue: dotnet/docs#44102

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test/tools/WebListener/Controllers/GetController.cs(20,38): error CS0121: The call is ambiguous between the following methods or properties: 'string.Join(string?, params string?[])' and 'string.Join(string?, params ReadOnlySpan<string?>)' [test/tools/WebListener/WebListener.csproj]
test/tools/WebListener/Controllers/GetController.cs(26,41): error CS0121: The call is ambiguous between the following methods or properties: 'string.Join(string?, params string?[])' and 'string.Join(string?, params ReadOnlySpan<string?>)' [test/tools/WebListener/WebListener.csproj]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is a breaking change, resolution is by updating code, e.g. dotnet/aspnetcore@7e353a3

Ilya (@iSazonov) This is a confirmed breaking change in .NET 9, see dotnet/docs#44102 (comment).

}

Hashtable headers = new Hashtable();
foreach (var key in Request.Headers.Keys)
{
headers.Add(key, string.Join(Constants.HeaderSeparator, Request.Headers[key]));
headers.Add(key, string.Join(Constants.HeaderSeparator, (string)Request.Headers[key]));
}

Hashtable output = new Hashtable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public JsonResult Index(IFormCollection collection)
Hashtable headers = new Hashtable();
foreach (var key in Request.Headers.Keys)
{
headers.Add(key, string.Join(Constants.HeaderSeparator, Request.Headers[key]));
headers.Add(key, string.Join(Constants.HeaderSeparator, (string)Request.Headers[key]));
}

Hashtable output = new Hashtable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public string Index()
Hashtable headers = new Hashtable();
foreach (var key in Request.Query.Keys)
{
headers.Add(key, string.Join(Constants.HeaderSeparator, Request.Query[key]));
headers.Add(key, string.Join(Constants.HeaderSeparator, (string)Request.Query[key]));

if (string.Equals("Content-Type", key, StringComparison.InvariantCultureIgnoreCase))
{
Expand Down