Removed file embeddings
This commit is contained in:
		
							parent
							
								
									7b3ac75543
								
							
						
					
					
						commit
						e910ccfd97
					
				@ -7,16 +7,9 @@
 | 
				
			|||||||
        <ImplicitUsings>enable</ImplicitUsings>
 | 
					        <ImplicitUsings>enable</ImplicitUsings>
 | 
				
			||||||
        <RootNamespace>PhotinoNetApp</RootNamespace>
 | 
					        <RootNamespace>PhotinoNetApp</RootNamespace>
 | 
				
			||||||
        <AssemblyName>PhotinoNetApp</AssemblyName>
 | 
					        <AssemblyName>PhotinoNetApp</AssemblyName>
 | 
				
			||||||
        <PublishSingleFile>true</PublishSingleFile>
 | 
					 | 
				
			||||||
        <SelfContained>true</SelfContained>
 | 
					 | 
				
			||||||
        <RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
 | 
					 | 
				
			||||||
        <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
 | 
					 | 
				
			||||||
        <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
 | 
					 | 
				
			||||||
        <PublishTrimmed>false</PublishTrimmed>
 | 
					 | 
				
			||||||
    </PropertyGroup>
 | 
					    </PropertyGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <ItemGroup>
 | 
					    <ItemGroup>
 | 
				
			||||||
      <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.1" />
 | 
					 | 
				
			||||||
      <PackageReference Include="Photino.NET" Version="2.6.0" />
 | 
					      <PackageReference Include="Photino.NET" Version="2.6.0" />
 | 
				
			||||||
    </ItemGroup>
 | 
					    </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -26,9 +19,4 @@
 | 
				
			|||||||
        </Content>
 | 
					        </Content>
 | 
				
			||||||
    </ItemGroup>
 | 
					    </ItemGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <ItemGroup>
 | 
					 | 
				
			||||||
<!--        <EmbeddedResource Include="EmbeddedFilesManifest.xml" />-->
 | 
					 | 
				
			||||||
        <EmbeddedResource Include="wwwroot\**\*" />
 | 
					 | 
				
			||||||
    </ItemGroup>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
</Project>
 | 
					</Project>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,4 @@
 | 
				
			|||||||
using System.Drawing;
 | 
					using System.Drawing;
 | 
				
			||||||
using System.Reflection;
 | 
					 | 
				
			||||||
using Microsoft.Extensions.FileProviders;
 | 
					 | 
				
			||||||
using PhotinoNET;
 | 
					using PhotinoNET;
 | 
				
			||||||
using PhotinoNetApp.Components;
 | 
					using PhotinoNetApp.Components;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -8,30 +6,18 @@ var builder = WebApplication.CreateBuilder();
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
builder.Services.AddRazorComponents()
 | 
					builder.Services.AddRazorComponents()
 | 
				
			||||||
    .AddInteractiveServerComponents();
 | 
					    .AddInteractiveServerComponents();
 | 
				
			||||||
builder.Services.AddSingleton<IFileProvider>(new ManifestEmbeddedFileProvider(Assembly.GetAssembly(type: typeof(Program))!, "/", "Microsoft.Extensions.FileProviders.Embedded.Manifest.xml", DateTimeOffset.Now));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// builder.WebHost.UseWebRoot("wwwroot");
 | 
					builder.WebHost.UseWebRoot("wwwroot");
 | 
				
			||||||
builder.WebHost.UseStaticWebAssets();
 | 
					builder.WebHost.UseStaticWebAssets();
 | 
				
			||||||
builder.WebHost.UseUrls("http://localhost:5000");
 | 
					builder.WebHost.UseUrls("http://localhost:5000");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var app = builder.Build();
 | 
					var app = builder.Build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// app.UseStaticFiles();
 | 
					app.UseStaticFiles();
 | 
				
			||||||
app.UseStaticFiles(new StaticFileOptions
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    FileProvider = app.Services.GetService<IFileProvider>(),
 | 
					 | 
				
			||||||
    // RequestPath = "/PhotinoNetApp",
 | 
					 | 
				
			||||||
    ServeUnknownFileTypes = true,
 | 
					 | 
				
			||||||
});
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
app.UseAntiforgery();
 | 
					app.UseAntiforgery();
 | 
				
			||||||
app.MapRazorComponents<App>()
 | 
					app.MapRazorComponents<App>()
 | 
				
			||||||
    .AddInteractiveServerRenderMode();
 | 
					    .AddInteractiveServerRenderMode();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
foreach (var file in Assembly.GetExecutingAssembly().GetManifestResourceNames())
 | 
					 | 
				
			||||||
    if (file.Contains("wwwroot"))
 | 
					 | 
				
			||||||
        app.Logger.LogWarning($"Public file: {file}");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
using var webServerCancellation = new CancellationTokenSource();
 | 
					using var webServerCancellation = new CancellationTokenSource();
 | 
				
			||||||
var webServerTask = app.RunAsync(webServerCancellation.Token);
 | 
					var webServerTask = app.RunAsync(webServerCancellation.Token);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user