Skip to content

Commit e47e52c

Browse files
committed
fix warning CA2254
1 parent c837a0d commit e47e52c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AssemblyLoader.netcore.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public PathAssemblyDependencyResolver(string componentAssemblyPath, ILogger logg
6060

6161
public override Assembly Resolve(MetadataLoadContext context, AssemblyName assemblyName)
6262
{
63-
logger?.LogDebug($"attempting to load '{assemblyName}'");
63+
logger?.LogDebug("attempting to load '{AssemblyName}'", assemblyName);
6464

6565
var assm = base.Resolve(context, assemblyName);
6666

@@ -70,12 +70,12 @@ public override Assembly Resolve(MetadataLoadContext context, AssemblyName assem
7070
var assemblyPath = dependencyResolver.ResolveAssemblyToPath(assemblyName);
7171

7272
if (assemblyPath is null) {
73-
logger?.LogDebug($"could not resolve assembly path of '{assemblyName}'");
73+
logger?.LogDebug("could not resolve assembly path of '{AssemblyName}'", assemblyName);
7474

7575
return null;
7676
}
7777

78-
logger?.LogDebug($"attempting to load assembly from '{assemblyPath}'");
78+
logger?.LogDebug("attempting to load assembly from '{AssemblyFilePath}'", assemblyPath);
7979

8080
return context.LoadFromAssemblyPath(assemblyPath);
8181
}
@@ -92,19 +92,19 @@ private static TResult UsingReflectionOnlyAssembly<TArg, TResult>(
9292
new PathAssemblyDependencyResolver(assemblyFile.FullName)
9393
);
9494

95-
logger?.LogDebug($"loading assembly into reflection-only context from file '{assemblyFile.FullName}'");
95+
logger?.LogDebug("loading assembly into reflection-only context from file '{AssemblyFilePath}'", assemblyFile.FullName);
9696

9797
var assm = mlc.LoadFromAssemblyPath(assemblyFile.FullName);
9898

9999
if (assm is null) {
100-
logger?.LogCritical($"failed to load assembly from file '{assemblyFile.FullName}'");
100+
logger?.LogCritical("failed to load assembly from file '{AssemblyFilePath}'", assemblyFile.FullName);
101101

102102
return default;
103103
}
104104

105105
var assemblyName = assm.FullName;
106106

107-
logger?.LogDebug($"loaded assembly '{assemblyName}'");
107+
logger?.LogDebug("loaded assembly '{AssemblyName}'", assemblyName);
108108

109109
return actionWithLoadedAssembly(assm, arg);
110110
}
@@ -127,12 +127,12 @@ protected override Assembly Load(AssemblyName name)
127127
var assemblyPath = dependencyResolver.ResolveAssemblyToPath(name);
128128

129129
if (assemblyPath is null) {
130-
logger?.LogDebug($"could not resolve assembly path of '{name}'");
130+
logger?.LogDebug("could not resolve assembly path of '{AssemblyName}'", name);
131131

132132
return null;
133133
}
134134

135-
logger?.LogDebug($"attempting to load assembly from '{assemblyPath}'");
135+
logger?.LogDebug("attempting to load assembly from '{AssemblyFilePath}'", assemblyPath);
136136

137137
return LoadFromAssemblyPath(assemblyPath);
138138
}
@@ -152,12 +152,12 @@ private static TResult UsingAssembly<TArg, TResult>(
152152
var alc = new UnloadableAssemblyLoadContext(assemblyFile.FullName, logger);
153153
var alcWeakReference = new WeakReference(alc);
154154

155-
logger?.LogDebug($"loading assembly from file '{assemblyFile.FullName}'");
155+
logger?.LogDebug("loading assembly from file '{AssemblyFilePath}'", assemblyFile.FullName);
156156

157157
var assm = alc.LoadFromAssemblyPath(assemblyFile.FullName);
158158

159159
if (assm is null) {
160-
logger?.LogCritical($"failed to load assembly from file '{assemblyFile.FullName}'");
160+
logger?.LogCritical("failed to load assembly from file '{AssemblyFilePath}'", assemblyFile.FullName);
161161

162162
return default;
163163
}
@@ -166,15 +166,15 @@ private static TResult UsingAssembly<TArg, TResult>(
166166

167167
var assemblyName = assm.FullName;
168168

169-
logger?.LogDebug($"loaded assembly '{assemblyName}'");
169+
logger?.LogDebug("loaded assembly '{AssemblyName}'", assemblyName);
170170

171171
try {
172172
return actionWithLoadedAssembly(assm, arg);
173173
}
174174
finally {
175175
alc.Unload();
176176

177-
logger?.LogDebug($"unloaded assembly '{assemblyName}'");
177+
logger?.LogDebug("unloaded assembly '{AssemblyName}'", assemblyName);
178178
}
179179
}
180180
}

0 commit comments

Comments
 (0)