Skip to content

Commit 1ca94ba

Browse files
committed
!!temporary!! Add some InjectRequestHandler logging
1 parent f6170ff commit 1ca94ba

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/Servers/IIS/IIS/test/testassets/TestTasks/InjectRequestHandler.cs

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class InjectRequestHandler
1414
{
1515
private const string aspnetcoreV2Name = "aspnetcorev2_inprocess.dll";
1616

17-
private static void Main(string[] args)
17+
private static int Main(string[] args)
1818
{
1919
string depsFile = args[0];
2020
string rid = "";
@@ -58,7 +58,35 @@ private static void Main(string[] args)
5858
)));
5959
var outputFolder = Path.GetDirectoryName(depsFile);
6060
var bitnessString = rid.Substring(rid.Length - 3, 3);
61-
File.Copy(Path.Combine(outputFolder, bitnessString, aspnetcoreV2Name), Path.Combine(outputFolder, aspnetcoreV2Name), overwrite: true);
61+
var inputFile = Path.Combine(outputFolder, bitnessString, aspnetcoreV2Name);
62+
if (!File.Exists(inputFile))
63+
{
64+
var found = false;
65+
foreach (var file in Directory.EnumerateFiles(
66+
outputFolder,
67+
aspnetcoreV2Name,
68+
SearchOption.AllDirectories))
69+
{
70+
found = true;
71+
Console.WriteLine($"Found '{file}'");
72+
}
73+
74+
if (!found)
75+
{
76+
foreach (var file in Directory.EnumerateFiles(
77+
Path.Combine(outputFolder, ".."),
78+
aspnetcoreV2Name,
79+
SearchOption.AllDirectories))
80+
{
81+
found = true;
82+
Console.WriteLine($"Retry found '{file}'");
83+
}
84+
}
85+
86+
return 1;
87+
}
88+
89+
File.Copy(inputFile, Path.Combine(outputFolder, aspnetcoreV2Name), overwrite: true);
6290
}
6391

6492
targetLibrary =
@@ -83,6 +111,8 @@ private static void Main(string[] args)
83111
{
84112
deps.WriteTo(writer);
85113
}
114+
115+
return 0;
86116
}
87117
}
88118
}

0 commit comments

Comments
 (0)