Skip to content

Commit 2862028

Browse files
authored
Bump up warning level for CA1822 (#39436)
Contributes to #24055
1 parent cf2679d commit 2862028

File tree

169 files changed

+428
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+428
-440
lines changed

.editorconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ dotnet_diagnostic.CA1810.severity = suggestion
105105
dotnet_diagnostic.CA1821.severity = warning
106106

107107
# CA1822: Make member static
108-
dotnet_diagnostic.CA1822.severity = suggestion
108+
dotnet_diagnostic.CA1822.severity = warning
109+
dotnet_code_quality.CA1822.api_surface = private, internal
109110

110111
# CA1823: Avoid unused private fields
111112
dotnet_diagnostic.CA1823.severity = warning
@@ -239,6 +240,8 @@ dotnet_diagnostic.CA1507.severity = suggestion
239240
dotnet_diagnostic.CA1802.severity = suggestion
240241
# CA1805: Do not initialize unnecessarily
241242
dotnet_diagnostic.CA1805.severity = suggestion
243+
# CA1822: Make member static
244+
dotnet_diagnostic.CA1822.severity = suggestion
242245
# CA1823: Avoid zero-length array allocations
243246
dotnet_diagnostic.CA1825.severity = suggestion
244247
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
@@ -278,6 +281,8 @@ dotnet_diagnostic.CA2016.severity = suggestion
278281
# Defaults for content in the shared src/ and shared runtime dir
279282

280283
[{**/Shared/runtime/**.{cs,vb},src/Shared/test/Shared.Tests/runtime/**.{cs,vb},**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}]
284+
# CA1822: Make member static
285+
dotnet_diagnostic.CA1822.severity = silent
281286
# IDE0011: Use braces
282287
dotnet_diagnostic.IDE0011.severity = silent
283288
# IDE0055: Fix formatting

src/Caching/SqlServer/src/DatabaseOperations.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public virtual void SetCacheItem(string key, byte[] value, DistributedCacheEntry
120120
{
121121
var utcNow = SystemClock.UtcNow;
122122

123-
var absoluteExpiration = GetAbsoluteExpiration(utcNow, options);
124-
ValidateOptions(options.SlidingExpiration, absoluteExpiration);
123+
var absoluteExpiration = DatabaseOperations.GetAbsoluteExpiration(utcNow, options);
124+
DatabaseOperations.ValidateOptions(options.SlidingExpiration, absoluteExpiration);
125125

126126
using (var connection = new SqlConnection(ConnectionString))
127127
using (var upsertCommand = new SqlCommand(SqlQueries.SetCacheItem, connection))
@@ -141,7 +141,7 @@ public virtual void SetCacheItem(string key, byte[] value, DistributedCacheEntry
141141
}
142142
catch (SqlException ex)
143143
{
144-
if (IsDuplicateKeyException(ex))
144+
if (DatabaseOperations.IsDuplicateKeyException(ex))
145145
{
146146
// There is a possibility that multiple requests can try to add the same item to the cache, in
147147
// which case we receive a 'duplicate key' exception on the primary key column.
@@ -160,8 +160,8 @@ public virtual void SetCacheItem(string key, byte[] value, DistributedCacheEntry
160160

161161
var utcNow = SystemClock.UtcNow;
162162

163-
var absoluteExpiration = GetAbsoluteExpiration(utcNow, options);
164-
ValidateOptions(options.SlidingExpiration, absoluteExpiration);
163+
var absoluteExpiration = DatabaseOperations.GetAbsoluteExpiration(utcNow, options);
164+
DatabaseOperations.ValidateOptions(options.SlidingExpiration, absoluteExpiration);
165165

166166
using (var connection = new SqlConnection(ConnectionString))
167167
using (var upsertCommand = new SqlCommand(SqlQueries.SetCacheItem, connection))
@@ -181,7 +181,7 @@ public virtual void SetCacheItem(string key, byte[] value, DistributedCacheEntry
181181
}
182182
catch (SqlException ex)
183183
{
184-
if (IsDuplicateKeyException(ex))
184+
if (DatabaseOperations.IsDuplicateKeyException(ex))
185185
{
186186
// There is a possibility that multiple requests can try to add the same item to the cache, in
187187
// which case we receive a 'duplicate key' exception on the primary key column.
@@ -285,7 +285,7 @@ protected virtual byte[] GetCacheItem(string key, bool includeValue)
285285
return value;
286286
}
287287

288-
protected bool IsDuplicateKeyException(SqlException ex)
288+
protected static bool IsDuplicateKeyException(SqlException ex)
289289
{
290290
if (ex.Errors != null)
291291
{
@@ -294,7 +294,7 @@ protected bool IsDuplicateKeyException(SqlException ex)
294294
return false;
295295
}
296296

297-
protected DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset utcNow, DistributedCacheEntryOptions options)
297+
protected static DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset utcNow, DistributedCacheEntryOptions options)
298298
{
299299
// calculate absolute expiration
300300
DateTimeOffset? absoluteExpiration = null;
@@ -314,7 +314,7 @@ protected bool IsDuplicateKeyException(SqlException ex)
314314
return absoluteExpiration;
315315
}
316316

317-
protected void ValidateOptions(TimeSpan? slidingExpiration, DateTimeOffset? absoluteExpiration)
317+
protected static void ValidateOptions(TimeSpan? slidingExpiration, DateTimeOffset? absoluteExpiration)
318318
{
319319
if (!slidingExpiration.HasValue && !absoluteExpiration.HasValue)
320320
{

src/Caching/SqlServer/src/MonoDatabaseOperations.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public override void SetCacheItem(string key, byte[] value, DistributedCacheEntr
110110
{
111111
var utcNow = SystemClock.UtcNow;
112112

113-
var absoluteExpiration = GetAbsoluteExpiration(utcNow, options);
114-
ValidateOptions(options.SlidingExpiration, absoluteExpiration);
113+
var absoluteExpiration = DatabaseOperations.GetAbsoluteExpiration(utcNow, options);
114+
DatabaseOperations.ValidateOptions(options.SlidingExpiration, absoluteExpiration);
115115

116116
using (var connection = new SqlConnection(ConnectionString))
117117
{
@@ -131,7 +131,7 @@ public override void SetCacheItem(string key, byte[] value, DistributedCacheEntr
131131
}
132132
catch (SqlException ex)
133133
{
134-
if (IsDuplicateKeyException(ex))
134+
if (DatabaseOperations.IsDuplicateKeyException(ex))
135135
{
136136
// There is a possibility that multiple requests can try to add the same item to the cache, in
137137
// which case we receive a 'duplicate key' exception on the primary key column.
@@ -150,8 +150,8 @@ public override void SetCacheItem(string key, byte[] value, DistributedCacheEntr
150150

151151
var utcNow = SystemClock.UtcNow;
152152

153-
var absoluteExpiration = GetAbsoluteExpiration(utcNow, options);
154-
ValidateOptions(options.SlidingExpiration, absoluteExpiration);
153+
var absoluteExpiration = DatabaseOperations.GetAbsoluteExpiration(utcNow, options);
154+
DatabaseOperations.ValidateOptions(options.SlidingExpiration, absoluteExpiration);
155155

156156
using (var connection = new SqlConnection(ConnectionString))
157157
{
@@ -171,7 +171,7 @@ public override void SetCacheItem(string key, byte[] value, DistributedCacheEntr
171171
}
172172
catch (SqlException ex)
173173
{
174-
if (IsDuplicateKeyException(ex))
174+
if (DatabaseOperations.IsDuplicateKeyException(ex))
175175
{
176176
// There is a possibility that multiple requests can try to add the same item to the cache, in
177177
// which case we receive a 'duplicate key' exception on the primary key column.

src/Caching/SqlServer/src/SqlQueries.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ public SqlQueries(string schemaName, string tableName)
8282
public string DeleteExpiredCacheItems { get; }
8383

8484
// From EF's SqlServerQuerySqlGenerator
85-
private string DelimitIdentifier(string identifier)
85+
private static string DelimitIdentifier(string identifier)
8686
{
8787
return "[" + identifier.Replace("]", "]]") + "]";
8888
}
8989

90-
private string EscapeLiteral(string literal)
90+
private static string EscapeLiteral(string literal)
9191
{
9292
return literal.Replace("'", "''");
9393
}

src/Caching/StackExchangeRedis/src/RedisCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public void Remove(string key)
406406
// TODO: Error handling
407407
}
408408

409-
private void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration)
409+
private static void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration)
410410
{
411411
absoluteExpiration = null;
412412
slidingExpiration = null;

src/Components/Analyzers/src/ComponentParametersShouldBePublicCodeFixProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
4747
diagnostic);
4848
}
4949

50-
private Task<Document> GetTransformedDocumentAsync(
50+
private static Task<Document> GetTransformedDocumentAsync(
5151
Document document,
5252
SyntaxNode root,
5353
PropertyDeclarationSyntax declarationNode)
@@ -57,7 +57,7 @@ private Task<Document> GetTransformedDocumentAsync(
5757
return Task.FromResult(document.WithSyntaxRoot(newSyntaxRoot));
5858
}
5959

60-
private SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
60+
private static SyntaxNode HandlePropertyDeclaration(PropertyDeclarationSyntax node)
6161
{
6262
TypeSyntax type = node.Type;
6363
if (type == null || type.IsMissing)

src/Components/Components/src/EventCallbackFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ public EventCallback<TValue> CreateInferred<TValue>(object receiver, Func<TValue
226226
return Create(receiver, callback);
227227
}
228228

229-
private EventCallback CreateCore(object receiver, MulticastDelegate callback)
229+
private static EventCallback CreateCore(object receiver, MulticastDelegate callback)
230230
{
231231
return new EventCallback(callback?.Target as IHandleEvent ?? receiver as IHandleEvent, callback);
232232
}
233233

234-
private EventCallback<TValue> CreateCore<TValue>(object receiver, MulticastDelegate callback)
234+
private static EventCallback<TValue> CreateCore<TValue>(object receiver, MulticastDelegate callback)
235235
{
236236
return new EventCallback<TValue>(callback?.Target as IHandleEvent ?? receiver as IHandleEvent, callback);
237237
}

src/Components/Components/src/Routing/RouteEntry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ internal void Match(RouteContext context)
124124
}
125125
}
126126

127-
private void AddDefaultValues(Dictionary<string, object> parameters, int templateIndex, TemplateSegment[] segments)
127+
private static void AddDefaultValues(Dictionary<string, object> parameters, int templateIndex, TemplateSegment[] segments)
128128
{
129129
for (var i = templateIndex; i < segments.Length; i++)
130130
{
@@ -133,7 +133,7 @@ private void AddDefaultValues(Dictionary<string, object> parameters, int templat
133133
}
134134
}
135135

136-
private bool RemainingSegmentsAreOptional(int index, TemplateSegment[] segments)
136+
private static bool RemainingSegmentsAreOptional(int index, TemplateSegment[] segments)
137137
{
138138
for (var i = index; index < segments.Length - 1; index++)
139139
{

src/Components/Web/src/Forms/InputBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private void UpdateAdditionalValidationAttributes()
272272
/// Returns a dictionary with the same values as the specified <paramref name="source"/>.
273273
/// </summary>
274274
/// <returns>true, if a new dictrionary with copied values was created. false - otherwise.</returns>
275-
private bool ConvertToDictionary(IReadOnlyDictionary<string, object>? source, out Dictionary<string, object> result)
275+
private static bool ConvertToDictionary(IReadOnlyDictionary<string, object>? source, out Dictionary<string, object> result)
276276
{
277277
var newDictionaryCreated = true;
278278
if (source == null)

src/Components/Web/src/Routing/NavLink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
168168
builder.CloseElement();
169169
}
170170

171-
private string? CombineWithSpace(string? str1, string str2)
171+
private static string? CombineWithSpace(string? str1, string str2)
172172
=> str1 == null ? str2 : $"{str1} {str2}";
173173

174174
private static bool IsStrictlyPrefixWithSeparator(string value, string prefix)

src/Components/WebAssembly/DevServer/src/Server/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public Startup(IConfiguration configuration)
1717

1818
public IConfiguration Configuration { get; }
1919

20-
public void ConfigureServices(IServiceCollection services)
20+
public static void ConfigureServices(IServiceCollection services)
2121
{
2222
services.AddRouting();
2323
}
2424

25-
public void Configure(IApplicationBuilder app, IConfiguration configuration)
25+
public static void Configure(IApplicationBuilder app, IConfiguration configuration)
2626
{
2727
app.UseDeveloperExceptionPage();
2828
EnableConfiguredPathbase(app, configuration);

src/Components/WebAssembly/WebAssembly.Authentication/src/Services/SignOutSessionStateManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private async ValueTask<SignOutState> GetSignOutState()
7070
[DynamicDependency(JsonSerialized, typeof(SignOutState))]
7171
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The correct members will be preserved by the above DynamicDependency.")]
7272
// This should use JSON source generation
73-
private SignOutState DeserializeSignOutState(string result) => JsonSerializer.Deserialize<SignOutState>(result, _serializationOptions);
73+
private static SignOutState DeserializeSignOutState(string result) => JsonSerializer.Deserialize<SignOutState>(result, _serializationOptions);
7474

7575
private ValueTask ClearSignOutState()
7676
{

src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyHostBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ private void InitializeRegisteredRootComponents(IJSUnmarshalledRuntime jsRuntime
118118
$"This is likely a result of trimming (tree shaking).");
119119
}
120120

121-
var definitions = componentDeserializer.GetParameterDefinitions(registeredComponent.ParameterDefinitions!);
122-
var values = componentDeserializer.GetParameterValues(registeredComponent.ParameterValues!);
121+
var definitions = WebAssemblyComponentParameterDeserializer.GetParameterDefinitions(registeredComponent.ParameterDefinitions!);
122+
var values = WebAssemblyComponentParameterDeserializer.GetParameterValues(registeredComponent.ParameterValues!);
123123
var parameters = componentDeserializer.DeserializeParameters(definitions, values);
124124

125125
RootComponents.Add(componentType, registeredComponent.PrerenderId!, parameters);
@@ -131,7 +131,7 @@ private void InitializePersistedState(IJSUnmarshalledRuntime jsRuntime)
131131
_persistedState = jsRuntime.InvokeUnmarshalled<string>("Blazor._internal.getPersistedState");
132132
}
133133

134-
private void InitializeNavigationManager(IJSUnmarshalledRuntime jsRuntime)
134+
private static void InitializeNavigationManager(IJSUnmarshalledRuntime jsRuntime)
135135
{
136136
var baseUri = jsRuntime.InvokeUnmarshalled<string>(BrowserNavigationManagerInterop.GetBaseUri);
137137
var uri = jsRuntime.InvokeUnmarshalled<string>(BrowserNavigationManagerInterop.GetLocationHref);

src/Components/WebAssembly/WebAssembly/src/HotReload/HotReloadAgent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public void ApplyDeltas(IReadOnlyList<UpdateDelta> deltas)
214214
}
215215
}
216216

217-
private Type[] GetMetadataUpdateTypes(IReadOnlyList<UpdateDelta> deltas)
217+
private static Type[] GetMetadataUpdateTypes(IReadOnlyList<UpdateDelta> deltas)
218218
{
219219
List<Type>? types = null;
220220

src/Components/WebAssembly/WebAssembly/src/Prerendering/ClientComponentParameterDeserializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public ParameterView DeserializeParameters(IList<ComponentParameter> parametersD
7575
[DynamicDependency(JsonSerialized, typeof(ComponentParameter))]
7676
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "The correct members will be preserved by the above DynamicDependency.")]
7777
// This should use JSON source generation
78-
public ComponentParameter[] GetParameterDefinitions(string parametersDefinitions)
78+
public static ComponentParameter[] GetParameterDefinitions(string parametersDefinitions)
7979
{
8080
return JsonSerializer.Deserialize<ComponentParameter[]>(parametersDefinitions, WebAssemblyComponentSerializationSettings.JsonSerializationOptions)!;
8181
}
8282

8383
[RequiresUnreferencedCode("This API attempts to JSON deserialize types which might be trimmed.")]
84-
public IList<object> GetParameterValues(string parameterValues)
84+
public static IList<object> GetParameterValues(string parameterValues)
8585
{
8686
return JsonSerializer.Deserialize<IList<object>>(parameterValues, WebAssemblyComponentSerializationSettings.JsonSerializationOptions)!;
8787
}

src/Components/WebAssembly/WebAssembly/src/Services/LazyAssemblyLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public Task<IEnumerable<Assembly>> LoadAssembliesAsync(IEnumerable<string> assem
5050
return LoadAssembliesInServerAsync(assembliesToLoad);
5151
}
5252

53-
private Task<IEnumerable<Assembly>> LoadAssembliesInServerAsync(IEnumerable<string> assembliesToLoad)
53+
private static Task<IEnumerable<Assembly>> LoadAssembliesInServerAsync(IEnumerable<string> assembliesToLoad)
5454
{
5555
var loadedAssemblies = new List<Assembly>();
5656

src/Components/WebAssembly/WebAssembly/src/Services/WebAssemblyConsoleLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void WriteMessage(LogLevel logLevel, string logName, int eventId, string
106106
}
107107
}
108108

109-
private void CreateDefaultLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception? exception)
109+
private static void CreateDefaultLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception? exception)
110110
{
111111
logBuilder.Append(GetLogLevelString(logLevel));
112112
logBuilder.Append(_loglevelPadding);

src/Components/WebView/WebView/src/IpcReceiver.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public async Task OnMessageReceivedAsync(PageContext pageContext, string message
6969
}
7070
}
7171

72-
private void BeginInvokeDotNet(PageContext pageContext, string callId, string assemblyName, string methodIdentifier, long dotNetObjectId, string argsJson)
72+
private static void BeginInvokeDotNet(PageContext pageContext, string callId, string assemblyName, string methodIdentifier, long dotNetObjectId, string argsJson)
7373
{
7474
DotNetDispatcher.BeginInvokeDotNet(
7575
pageContext.JSRuntime,
7676
new DotNetInvocationInfo(assemblyName, methodIdentifier, dotNetObjectId, callId),
7777
argsJson);
7878
}
7979

80-
private void EndInvokeJS(PageContext pageContext, long asyncHandle, bool succeeded, string argumentsOrError)
80+
private static void EndInvokeJS(PageContext pageContext, long asyncHandle, bool succeeded, string argumentsOrError)
8181
{
8282
DotNetDispatcher.EndInvokeJS(pageContext.JSRuntime, argumentsOrError);
8383
}
@@ -87,7 +87,7 @@ private static void ReceiveByteArrayFromJS(PageContext pageContext, int id, byte
8787
DotNetDispatcher.ReceiveByteArray(pageContext.JSRuntime, id, data);
8888
}
8989

90-
private void OnRenderCompleted(PageContext pageContext, long batchId, string errorMessageOrNull)
90+
private static void OnRenderCompleted(PageContext pageContext, long batchId, string errorMessageOrNull)
9191
{
9292
if (errorMessageOrNull != null)
9393
{
@@ -97,7 +97,7 @@ private void OnRenderCompleted(PageContext pageContext, long batchId, string err
9797
pageContext.Renderer.NotifyRenderCompleted(batchId);
9898
}
9999

100-
private void OnLocationChanged(PageContext pageContext, string uri, bool intercepted)
100+
private static void OnLocationChanged(PageContext pageContext, string uri, bool intercepted)
101101
{
102102
pageContext.NavigationManager.LocationUpdated(uri, intercepted);
103103
}

src/FileProviders/Manifest.MSBuildTask/src/Entry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private bool HasName(string currentSegment)
9090
return string.Equals(Name, currentSegment, StringComparison.Ordinal);
9191
}
9292

93-
private bool SameChildren(ISet<Entry> left, ISet<Entry> right)
93+
private static bool SameChildren(ISet<Entry> left, ISet<Entry> right)
9494
{
9595
if (left.Count != right.Count)
9696
{

src/FileProviders/Manifest.MSBuildTask/src/GenerateEmbeddedResourcesManifest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ public Manifest BuildManifest(EmbeddedItem[] processedItems)
9090
return manifest;
9191
}
9292

93-
private string GetManifestPath(ITaskItem taskItem) => string.Equals(taskItem.GetMetadata(LogicalName), taskItem.GetMetadata(ManifestResourceName)) ?
93+
private static string GetManifestPath(ITaskItem taskItem) => string.Equals(taskItem.GetMetadata(LogicalName), taskItem.GetMetadata(ManifestResourceName)) ?
9494
taskItem.GetMetadata(TargetPath) :
9595
NormalizePath(taskItem.GetMetadata(LogicalName));
9696

97-
private string GetAssemblyResourceName(ITaskItem taskItem) => string.Equals(taskItem.GetMetadata(LogicalName), taskItem.GetMetadata(ManifestResourceName)) ?
97+
private static string GetAssemblyResourceName(ITaskItem taskItem) => string.Equals(taskItem.GetMetadata(LogicalName), taskItem.GetMetadata(ManifestResourceName)) ?
9898
taskItem.GetMetadata(ManifestResourceName) :
9999
taskItem.GetMetadata(LogicalName);
100100

101-
private string NormalizePath(string path) => Path.DirectorySeparatorChar == '\\' ?
101+
private static string NormalizePath(string path) => Path.DirectorySeparatorChar == '\\' ?
102102
path.Replace("/", "\\") : path.Replace("\\", "/");
103103
}

src/Hosting/Server.IntegrationTesting/src/CachingApplicationPublisher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public override async Task<PublishedApplication> Publish(DeploymentParameters de
4747
return new PublishedApplication(CopyPublishedOutput(publishedApplication, logger), logger);
4848
}
4949

50-
private string CopyPublishedOutput(PublishedApplication application, ILogger logger)
50+
private static string CopyPublishedOutput(PublishedApplication application, ILogger logger)
5151
{
5252
var target = CreateTempDirectory();
5353

0 commit comments

Comments
 (0)