Skip to content

Commit

Permalink
Remove check for embedded files
Browse files Browse the repository at this point in the history
The mechanism to check for embedded resource files did not work
as expected and was removed. The application will throw an error
when the Resources folder was not present at build time and no
manifest file was created.
  • Loading branch information
philippjbauer committed Sep 26, 2022
1 parent 99fe601 commit c2be700
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Photino.NET/PhotinoServer.NET.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,10 @@ public static WebApplication CreateStaticFileServer(
System.Reflection.Assembly.GetEntryAssembly(),
$"Resources/{webRootFolder}");

bool hasEmbeddedContents = manifestEmbeddedFileProvider
.GetDirectoryContents("")
.Any();

var physicalFileProvider = builder.Environment.WebRootFileProvider;

CompositeFileProvider compositeWebProvider;
if (hasEmbeddedContents)
{
compositeWebProvider = new(manifestEmbeddedFileProvider, physicalFileProvider);
}
else
{
compositeWebProvider = new(physicalFileProvider);
}
CompositeFileProvider compositeWebProvider
= new(manifestEmbeddedFileProvider, physicalFileProvider);

builder.Environment.WebRootFileProvider = compositeWebProvider;

Expand Down

0 comments on commit c2be700

Please sign in to comment.