Skip to content

Commit be179de

Browse files
authored
Update samples (#530)
This change does the following: - Create a .slnLaunch file to easily launch the samples (including the multi-app samples) - Target .NET 8.0 for samples - Update YARP to 2.1.0 - Clean up registrations to recommended patterns - Convert samples to use MSBuild.SDK.SystemWeb - Directory.Build.[props|targets] for samples can now bring in the arcade sdk for more consistent projects
1 parent 7c40b6c commit be179de

File tree

224 files changed

+1341
-154550
lines changed

Some content is hidden

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

224 files changed

+1341
-154550
lines changed

Directory.Build.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3-
<!-- Leave this file here, even if it's empty. It stops chaining imports. -->
4-
53
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
64

75
<PropertyGroup Condition="'$(CopyrightMicrosoft)' != ''">

Microsoft.AspNetCore.SystemWebAdapters.sln

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2121
Directory.Build.props = Directory.Build.props
2222
Directory.Build.targets = Directory.Build.targets
2323
global.json = global.json
24+
NuGet.config = NuGet.config
2425
README.md = README.md
2526
EndProjectSection
2627
EndProject
@@ -32,15 +33,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A1BDA50C-D
3233
test\Directory.Build.targets = test\Directory.Build.targets
3334
EndProjectSection
3435
EndProject
35-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteBearer", "samples\RemoteAuth\Bearer\RemoteBearer\RemoteBearer.csproj", "{898C9B2C-E43A-434F-9927-F6697C0ACE40}"
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RemoteBearer", "samples\RemoteAuth\Bearer\RemoteBearer\RemoteBearer.csproj", "{898C9B2C-E43A-434F-9927-F6697C0ACE40}"
3637
EndProject
3738
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RemoteBearerCore", "samples\RemoteAuth\Bearer\RemoteBearerCore\RemoteBearerCore.csproj", "{6ECC8509-2937-4667-AECC-C20BA62D3FC5}"
3839
EndProject
39-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormsAuth", "samples\RemoteAuth\Forms\FormsAuth\FormsAuth.csproj", "{87223E5F-A0B2-4827-A4A4-B4C40BEAFBE8}"
40+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FormsAuth", "samples\RemoteAuth\Forms\FormsAuth\FormsAuth.csproj", "{87223E5F-A0B2-4827-A4A4-B4C40BEAFBE8}"
4041
EndProject
4142
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FormsAuthCore", "samples\RemoteAuth\Forms\FormsAuthCore\FormsAuthCore.csproj", "{EB87A63B-D71F-43E3-B0B7-588B4BED3BE3}"
4243
EndProject
43-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OIDCAuth", "samples\RemoteAuth\OIDC\OIDCAuth\OIDCAuth.csproj", "{0BA8335A-9F56-4439-9A71-4BD5B58C2273}"
44+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OIDCAuth", "samples\RemoteAuth\OIDC\OIDCAuth\OIDCAuth.csproj", "{0BA8335A-9F56-4439-9A71-4BD5B58C2273}"
4445
EndProject
4546
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OIDCAuthCore", "samples\RemoteAuth\OIDC\OIDCAuthCore\OIDCAuthCore.csproj", "{32192715-5F15-4E11-B96F-971468DA33E6}"
4647
EndProject
@@ -68,23 +69,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.System
6869
EndProject
6970
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{9C8EBDB5-FA17-4C9C-8946-04692AC752CE}"
7071
EndProject
71-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcApp", "samples\RemoteAuth\Identity\MvcApp\MvcApp.csproj", "{174A36F1-27ED-43FC-A3A1-00DA58C4E30C}"
72+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcApp", "samples\RemoteAuth\Identity\MvcApp\MvcApp.csproj", "{174A36F1-27ED-43FC-A3A1-00DA58C4E30C}"
7273
EndProject
7374
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MvcCoreApp", "samples\RemoteAuth\Identity\MvcCoreApp\MvcCoreApp.csproj", "{2BF8EE74-1AB3-4DB8-ADDE-27A35981CA04}"
7475
EndProject
7576
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreApp", "samples\CoreApp\CoreApp.csproj", "{431651D7-D40A-403E-813C-496A1414AA22}"
7677
EndProject
7778
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebFormsToBlazor", "WebFormsToBlazor", "{3A71E8B4-7E40-4326-B5FC-0CFA30A388D1}"
7879
EndProject
79-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebFormsFramework", "samples\WebFormsToBlazor\WebFormsFramework\WebFormsFramework.csproj", "{0993BA4C-218B-43DD-A8A0-997B05808A08}"
80+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebFormsFramework", "samples\WebFormsToBlazor\WebFormsFramework\WebFormsFramework.csproj", "{0993BA4C-218B-43DD-A8A0-997B05808A08}"
8081
EndProject
8182
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorCore", "samples\WebFormsToBlazor\BlazorCore\BlazorCore.csproj", "{23094126-C05C-4172-A01F-998780976709}"
8283
EndProject
8384
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{4ED7A31C-8DBE-4A32-A17A-D72794F9FE2C}"
8485
EndProject
8586
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesLibrary", "samples\Modules\ModulesLibrary\ModulesLibrary.csproj", "{5597A485-4D9B-4CE6-A489-DEBE9338450F}"
8687
EndProject
87-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModulesFramework", "samples\Modules\ModulesFramework\ModulesFramework.csproj", "{B262AD69-11F0-4AE0-949A-AEAA2300C061}"
88+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesFramework", "samples\Modules\ModulesFramework\ModulesFramework.csproj", "{B262AD69-11F0-4AE0-949A-AEAA2300C061}"
8889
EndProject
8990
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesCore", "samples\Modules\ModulesCore\ModulesCore.csproj", "{F8B33C59-27CF-45DC-955C-2EBF9DA9DB7E}"
9091
EndProject
@@ -94,12 +95,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MachineKeyShared", "samples
9495
EndProject
9596
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MachineKeyCore", "samples\MachineKey\MachineKeyCore\MachineKeyCore.csproj", "{6C83077B-AF80-44BC-BA9F-D1E3264F321C}"
9697
EndProject
97-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MachineKeyFramework", "samples\MachineKey\MachineKeyFramework\MachineKeyFramework.csproj", "{FA39AC22-0725-4532-A682-B054ADA5BDA2}"
98+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MachineKeyFramework", "samples\MachineKey\MachineKeyFramework\MachineKeyFramework.csproj", "{FA39AC22-0725-4532-A682-B054ADA5BDA2}"
9899
EndProject
99100
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SystemWebAdapters.NuGet.Tests", "test\Microsoft.AspNetCore.SystemWebAdapters.NuGet.Tests\Microsoft.AspNetCore.SystemWebAdapters.NuGet.Tests.csproj", "{17055F45-E79A-41EF-825E-0B2211433729}"
100101
EndProject
101102
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SystemWebAdapters.Apis.Tests", "test\Microsoft.AspNetCore.SystemWebAdapters.Apis.Tests\Microsoft.AspNetCore.SystemWebAdapters.Apis.Tests.csproj", "{E4D9A131-DC4E-403F-A10F-65F5E5E42475}"
102103
EndProject
104+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrameworkSampleUtilities", "samples\FrameworkSampleUtilities\FrameworkSampleUtilities.csproj", "{7F09946A-3D08-4A34-9C6A-F1D6557E4FAD}"
105+
EndProject
103106
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsAuth", "samples\WindowsAuth\WindowsAuth.csproj", "{B5E840F8-2021-4175-BFBF-F9447506242E}"
104107
EndProject
105108
Global
@@ -228,6 +231,10 @@ Global
228231
{B5E840F8-2021-4175-BFBF-F9447506242E}.Debug|Any CPU.Build.0 = Debug|Any CPU
229232
{B5E840F8-2021-4175-BFBF-F9447506242E}.Release|Any CPU.ActiveCfg = Release|Any CPU
230233
{B5E840F8-2021-4175-BFBF-F9447506242E}.Release|Any CPU.Build.0 = Release|Any CPU
234+
{7F09946A-3D08-4A34-9C6A-F1D6557E4FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
235+
{7F09946A-3D08-4A34-9C6A-F1D6557E4FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
236+
{7F09946A-3D08-4A34-9C6A-F1D6557E4FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
237+
{7F09946A-3D08-4A34-9C6A-F1D6557E4FAD}.Release|Any CPU.Build.0 = Release|Any CPU
231238
EndGlobalSection
232239
GlobalSection(SolutionProperties) = preSolution
233240
HideSolutionNode = FALSE
@@ -271,6 +278,7 @@ Global
271278
{17055F45-E79A-41EF-825E-0B2211433729} = {A1BDA50C-D70B-416C-97F1-74B0649797C5}
272279
{E4D9A131-DC4E-403F-A10F-65F5E5E42475} = {A1BDA50C-D70B-416C-97F1-74B0649797C5}
273280
{B5E840F8-2021-4175-BFBF-F9447506242E} = {95915611-30BF-4AFF-AE41-5CDC6F57DCF7}
281+
{7F09946A-3D08-4A34-9C6A-F1D6557E4FAD} = {95915611-30BF-4AFF-AE41-5CDC6F57DCF7}
274282
EndGlobalSection
275283
GlobalSection(ExtensibilityGlobals) = postSolution
276284
SolutionGuid = {DABA3C65-9D74-4EB6-9B1C-730328710EAD}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
[
2+
{
3+
"Name": "Sample: Authentication (Forms)",
4+
"Projects": [
5+
{
6+
"Path": "samples\\RemoteAuth\\Forms\\FormsAuth\\FormsAuth.csproj",
7+
"Action": "Start",
8+
"DebugTarget": "IIS Express"
9+
},
10+
{
11+
"Path": "samples\\RemoteAuth\\Forms\\FormsAuthCore\\FormsAuthCore.csproj",
12+
"Action": "Start",
13+
"DebugTarget": "FormsAuthCore"
14+
}
15+
]
16+
},
17+
{
18+
"Name": "Sample: Blazor Components",
19+
"Projects": [
20+
{
21+
"Path": "samples\\WebFormsToBlazor\\WebFormsFramework\\WebFormsFramework.csproj",
22+
"Action": "Start"
23+
},
24+
{
25+
"Path": "samples\\WebFormsToBlazor\\BlazorCore\\BlazorCore.csproj",
26+
"Action": "Start"
27+
}
28+
]
29+
},
30+
{
31+
"Name": "Sample: Authentication (Identity)",
32+
"Projects": [
33+
{
34+
"Path": "samples\\RemoteAuth\\Identity\\MvcApp\\MvcApp.csproj",
35+
"Action": "Start"
36+
},
37+
{
38+
"Path": "samples\\RemoteAuth\\Identity\\MvcCoreApp\\MvcCoreApp.csproj",
39+
"Action": "Start"
40+
}
41+
]
42+
},
43+
{
44+
"Name": "Sample: Authentication (OIDC)",
45+
"Projects": [
46+
{
47+
"Path": "samples\\RemoteAuth\\OIDC\\OIDCAuth\\OIDCAuth.csproj",
48+
"Action": "Start"
49+
},
50+
{
51+
"Path": "samples\\RemoteAuth\\OIDC\\OIDCAuthCore\\OIDCAuthCore.csproj",
52+
"Action": "Start"
53+
}
54+
]
55+
},
56+
{
57+
"Name": "Sample: Authentication (Bearer)",
58+
"Projects": [
59+
{
60+
"Path": "samples\\RemoteAuth\\Bearer\\RemoteBearer\\RemoteBearer.csproj",
61+
"Action": "Start"
62+
},
63+
{
64+
"Path": "samples\\RemoteAuth\\Bearer\\RemoteBearerCore\\RemoteBearerCore.csproj",
65+
"Action": "Start"
66+
}
67+
]
68+
},
69+
{
70+
"Name": "Sample: MachineKey",
71+
"Projects": [
72+
{
73+
"Path": "samples\\MachineKey\\MachineKeyCore\\MachineKeyCore.csproj",
74+
"Action": "Start"
75+
},
76+
{
77+
"Path": "samples\\MachineKey\\MachineKeyFramework\\MachineKeyFramework.csproj",
78+
"Action": "Start"
79+
}
80+
]
81+
},
82+
{
83+
"Name": "Sample: Modules",
84+
"Projects": [
85+
{
86+
"Path": "samples\\Modules\\ModulesFramework\\ModulesFramework.csproj",
87+
"Action": "Start"
88+
},
89+
{
90+
"Path": "samples\\Modules\\ModulesCore\\ModulesCore.csproj",
91+
"Action": "Start"
92+
}
93+
]
94+
},
95+
{
96+
"Name": "Sample: Adapters",
97+
"Projects": [
98+
{
99+
"Path": "samples\\CoreApp\\CoreApp.csproj",
100+
"Action": "Start"
101+
}
102+
]
103+
}
104+
]

global.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
},
2020
"msbuild-sdks": {
21+
"MSBuild.SDK.SystemWeb": "4.0.88",
2122
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24423.2"
2223
}
2324
}

samples/ClassLibrary/ClassLibrary.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5-
<LangVersion>10</LangVersion>
65
</PropertyGroup>
76

87
<ItemGroup>

samples/ClassLibrary/SimpleJsonWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public SimpleJsonWriter(HttpResponse response)
1818
_response.Output.WriteLine("{");
1919
}
2020

21-
public void Dispose()
21+
public readonly void Dispose()
2222
{
2323
if (_hasWritten)
2424
{

samples/CoreApp/CoreApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

samples/Directory.Build.props

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,53 @@
1-
<!-- Disable any build stuff brought in by arcade for the samples.
2-
By default, Arcade will bring in PackageReferences which will break any old-style projects (they will prefer those packages over packages.config) -->
31
<Project>
2+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
3+
4+
<!-- When consuming the NuGet package, this is automatically added, but we must add it manually -->
5+
<Import Project="$(MSBuildThisFileDirectory)../src/Microsoft.AspNetCore.SystemWebAdapters/Build/Microsoft.AspNetCore.SystemWebAdapters.props"/>
6+
47
<PropertyGroup>
5-
<LangVersion>11</LangVersion>
8+
<!-- MSBuild.SDK.SystemWeb tries to bring in default versions of the compilers, but that is now handled automatically by .NET 9 SDK -->
9+
<ExcludeSDKDefaultPackages>true</ExcludeSDKDefaultPackages>
10+
11+
<!-- This allows the first build to be correct without any warnings on a new clone of the repo -->
12+
<GeneratedBindingRedirectsAction>Overwrite</GeneratedBindingRedirectsAction>
13+
</PropertyGroup>
14+
15+
<PropertyGroup>
16+
<NoWarn>
17+
$(NoWarn);
18+
CA1024;
19+
CA1031;
20+
CA1051;
21+
CA1052;
22+
CA1054;
23+
CA1056;
24+
CA1062;
25+
CA1305;
26+
CA1515;
27+
CA1822;
28+
CA1852;
29+
CA1861;
30+
CA1722;
31+
CA1707;
32+
CA1716;
33+
CA1721;
34+
CA1752;
35+
CA2000;
36+
CA2211;
37+
CA2227;
38+
CA3002;
39+
CA3147;
40+
CA5368;
41+
CA5394;
42+
CA5395;
43+
CA5391;
44+
CS8603;
45+
CS8604;
46+
CS8618;
47+
CS8625;
48+
IDE0037;
49+
IDE0060;
50+
IDE1006;
51+
</NoWarn>
652
</PropertyGroup>
753
</Project>

samples/Directory.Build.targets

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
1-
<!-- Disable any build stuff brought in by arcade for the samples.
2-
By default, Arcade will bring in PackageReferences which will break any old-style projects (they will prefer those packages over packages.config) -->
31
<Project>
42
<!-- CI builds will run `dotnet test` which expects a target named test. The samples have no target for that, so this enables
53
an empty target so that this command will work and be a no-op for the tests. -->
64
<Target Name="Test"></Target>
5+
6+
<!--
7+
Used to know where the content directories are so we can serve themup in the samples.
8+
9+
This is potentially something we'll want to move into the framework services library for general
10+
use, but for now, we can test it out in the samples. -->
11+
<Target Name="WriteNuGetContentFiles"
12+
DependsOnTargets="AddNugetContentFiles"
13+
BeforeTargets="AssignTargetPaths">
14+
<PropertyGroup>
15+
<_NuGetContentMapName>contentDirectories.txt</_NuGetContentMapName>
16+
<_NuGetContentPath>$(IntermediateOutputPath)$(_NuGetContentMapName)</_NuGetContentPath>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<_NuGetContentDirectories Include="%(_NuGetContentFiles.BasePath)" />
21+
</ItemGroup>
22+
23+
<WriteLinesToFile
24+
File="$(_NuGetContentPath)"
25+
Lines="@(_NuGetContentDirectories)"
26+
Overwrite="true"
27+
WriteOnlyWhenDifferent="true" />
28+
29+
<ItemGroup Condition=" '@(_NuGetContentDirectories)' != '' ">
30+
<Content Include="$(_NuGetContentPath)">
31+
<Link>$(_NuGetContentMapName)</Link>
32+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
33+
</Content>
34+
</ItemGroup>
35+
</Target>
36+
37+
<!-- When consuming the NuGet package, this is automatically added, but we must add it manually -->
38+
<Import Project="$(MSBuildThisFileDirectory)../src/Microsoft.AspNetCore.SystemWebAdapters/Build/Microsoft.AspNetCore.SystemWebAdapters.targets"/>
39+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
740
</Project>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Web;
5+
using System.Web.Hosting;
6+
using Microsoft.AspNetCore.SystemWebAdapters;
7+
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.Extensions.FileProviders;
9+
10+
namespace System.Web;
11+
12+
public static class ContentFileExtensions
13+
{
14+
/// <summary>
15+
/// When using the <code>CopyContentFiles="true"</code> with PackageReference the 'Content' files will be copied to the bin directory, but does not get picked up when launching from VS.
16+
/// This adds a <see cref="VirtualPathProvider"/> that helps resolve those files as well as a module that will serve them up during development.
17+
/// </summary>
18+
/// <remarks>For the samples, there is a custom target that will add a file called 'contentDirectories.txt' with each directory that had a 'Content' folder.</remarks>
19+
/// <param name="services"></param>
20+
public static ISystemWebAdapterBuilder AddVirtualizedContentDirectories(this ISystemWebAdapterBuilder builder)
21+
{
22+
if (GetProvider() is { } provider)
23+
{
24+
HostingEnvironment.RegisterVirtualPathProvider(new FileProviderVirtualPathProvider(provider));
25+
26+
builder.Services.AddSingleton<IHttpModule>(new StaticFileProviderHttpModule(provider));
27+
}
28+
29+
return builder;
30+
}
31+
32+
private static CompositeFileProvider? GetProvider()
33+
{
34+
var binDir = Path.Combine(HttpRuntime.BinDirectory, "contentDirectories.txt");
35+
36+
if (File.Exists(binDir))
37+
{
38+
var providers = new List<IFileProvider>();
39+
40+
foreach (var line in File.ReadAllLines(binDir))
41+
{
42+
if (Directory.Exists(line))
43+
{
44+
providers.Add(new PhysicalFileProvider(line));
45+
}
46+
}
47+
48+
if (providers.Count != 0)
49+
{
50+
return new CompositeFileProvider(providers);
51+
}
52+
}
53+
54+
return null;
55+
}
56+
}

0 commit comments

Comments
 (0)