Skip to content

Update SDK to 8.0.100-rc.1.23381.2 #49761

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

Merged
merged 9 commits into from
Jul 31, 2023
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
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "8.0.100-preview.7.23360.1"
"version": "8.0.100-rc.1.23381.2"
},
"tools": {
"dotnet": "8.0.100-preview.7.23360.1",
"dotnet": "8.0.100-rc.1.23381.2",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand Down
2 changes: 2 additions & 0 deletions src/Caching/SqlServer/src/SqlServerCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ public SqlServerCache(IOptions<SqlServerCacheOptions> options)
}
if (cacheOptions.DefaultSlidingExpiration <= TimeSpan.Zero)
{
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
throw new ArgumentOutOfRangeException(
nameof(cacheOptions.DefaultSlidingExpiration),
cacheOptions.DefaultSlidingExpiration,
"The sliding expiration value must be positive.");
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
}

_systemClock = cacheOptions.SystemClock ?? new SystemClock();
Expand Down
2 changes: 2 additions & 0 deletions src/Caching/StackExchangeRedis/src/RedisCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,12 @@ private async Task RefreshAsync(IDatabase cache, string key, DateTimeOffset? abs
{
if (options.AbsoluteExpiration.HasValue && options.AbsoluteExpiration <= creationTime)
{
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
throw new ArgumentOutOfRangeException(
nameof(DistributedCacheEntryOptions.AbsoluteExpiration),
options.AbsoluteExpiration.Value,
"The absolute expiration value must be in the future.");
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
}

if (options.AbsoluteExpirationRelativeToNow.HasValue)
Expand Down
5 changes: 2 additions & 3 deletions src/Components/Components/src/Routing/TemplateSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public TemplateSegment(string template, string segment, bool isParameter)
Value = segment[1..];
}

var invalidCharacterIndex = Value.IndexOf('*');
if (invalidCharacterIndex != -1)
if (Value.Contains('*'))
{
throw new InvalidOperationException($"Invalid template '{template}'. A catch-all parameter may only have '*' or '**' at the beginning of the segment.");
}
Expand Down Expand Up @@ -93,7 +92,7 @@ public TemplateSegment(string template, string segment, bool isParameter)

// Moving the check for this here instead of TemplateParser so we can allow catch-all.
// We checked for '*' up above specifically for catch-all segments, this one checks for all others
if (Value.IndexOf('*') != -1)
if (Value.Contains('*'))
{
throw new InvalidOperationException($"Invalid template '{template}'. The character '*' in parameter segment '{{{segment}}}' is not allowed.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<SelfContained>true</SelfContained>
<UseMonoRuntime>true</UseMonoRuntime>
<UsingMicrosoftNETSdkBlazorWebAssembly>true</UsingMicrosoftNETSdkBlazorWebAssembly>
<UsingMicrosoftNETSdkWebAssembly>true</UsingMicrosoftNETSdkWebAssembly>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Http/src/Internal/ResponseCookies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,20 @@ public void Delete(string key, CookieOptions options)
{
rejectPredicate = (value, encKeyPlusEquals, opts) =>
value.StartsWith(encKeyPlusEquals, StringComparison.OrdinalIgnoreCase) &&
value.IndexOf($"domain={opts.Domain}", StringComparison.OrdinalIgnoreCase) != -1 &&
value.IndexOf($"path={opts.Path}", StringComparison.OrdinalIgnoreCase) != -1;
value.Contains($"domain={opts.Domain}", StringComparison.OrdinalIgnoreCase) &&
value.Contains($"path={opts.Path}", StringComparison.OrdinalIgnoreCase);
}
else if (domainHasValue)
{
rejectPredicate = (value, encKeyPlusEquals, opts) =>
value.StartsWith(encKeyPlusEquals, StringComparison.OrdinalIgnoreCase) &&
value.IndexOf($"domain={opts.Domain}", StringComparison.OrdinalIgnoreCase) != -1;
value.Contains($"domain={opts.Domain}", StringComparison.OrdinalIgnoreCase);
}
else if (pathHasValue)
{
rejectPredicate = (value, encKeyPlusEquals, opts) =>
value.StartsWith(encKeyPlusEquals, StringComparison.OrdinalIgnoreCase) &&
value.IndexOf($"path={opts.Path}", StringComparison.OrdinalIgnoreCase) != -1;
value.Contains($"path={opts.Path}", StringComparison.OrdinalIgnoreCase);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Routing/src/Patterns/RoutePatternParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ private static bool IsValidLiteral(Context context, string literal)
Debug.Assert(context != null);
Debug.Assert(literal != null);

if (literal.IndexOf(QuestionMark) != -1)
if (literal.Contains(QuestionMark))
{
context.Error = Resources.FormatTemplateRoute_InvalidLiteral(literal);
return false;
Expand Down
4 changes: 4 additions & 0 deletions src/Logging.AzureAppServices/src/BatchingLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ internal BatchingLoggerProvider(IOptionsMonitor<BatchingLoggerOptions> options)
var loggerOptions = options.CurrentValue;
if (loggerOptions.BatchSize <= 0)
{
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
throw new ArgumentOutOfRangeException(nameof(loggerOptions.BatchSize), $"{nameof(loggerOptions.BatchSize)} must be a positive number.");
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
}
if (loggerOptions.FlushPeriod <= TimeSpan.Zero)
{
#pragma warning disable CA2208 // Instantiate argument exceptions correctly
throw new ArgumentOutOfRangeException(nameof(loggerOptions.FlushPeriod), $"{nameof(loggerOptions.FlushPeriod)} must be longer than zero.");
#pragma warning restore CA2208 // Instantiate argument exceptions correctly
}

_interval = loggerOptions.FlushPeriod;
Expand Down
4 changes: 2 additions & 2 deletions src/Mvc/Mvc.Razor/src/ViewPath.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Mvc.Razor;
Expand All @@ -8,7 +8,7 @@ internal static class ViewPath
public static string NormalizePath(string path)
{
var addLeadingSlash = path[0] != '\\' && path[0] != '/';
var transformSlashes = path.IndexOf('\\') != -1;
var transformSlashes = path.Contains('\\');

if (!addLeadingSlash && !transformSlashes)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Shared/ChunkingCookieManager/ChunkingCookieManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ public void DeleteCookie(HttpContext context, string key, CookieOptions options)
Func<string, bool> predicate = value => keys.Any(k => value.StartsWith(k, StringComparison.OrdinalIgnoreCase));
if (domainHasValue)
{
rejectPredicate = value => predicate(value) && value.IndexOf("domain=" + options.Domain, StringComparison.OrdinalIgnoreCase) != -1;
rejectPredicate = value => predicate(value) && value.Contains("domain=" + options.Domain, StringComparison.OrdinalIgnoreCase);
}
else if (pathHasValue)
{
rejectPredicate = value => predicate(value) && value.IndexOf("path=" + options.Path, StringComparison.OrdinalIgnoreCase) != -1;
rejectPredicate = value => predicate(value) && value.Contains("path=" + options.Path, StringComparison.OrdinalIgnoreCase);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ public static CommandOption Option(this CommandLineApplication command, string t
=> command.Option(
template,
description,
template.IndexOf("<", StringComparison.Ordinal) != -1
#if NETCOREAPP
template.Contains('<')
#else
template.IndexOf('<') != -1
#endif
? template.EndsWith(">...", StringComparison.Ordinal) ? CommandOptionType.MultipleValue : CommandOptionType.SingleValue
: CommandOptionType.NoValue);

Expand Down