When I run my Devops pipeline, it creates the WebApp.zip
file for a .NET Core web app on Azure.
That file includes all my content and a wwwroot
folder.
When I run the app, I get 404 for files outside the wwwroot
folder that is generated in the pipeline. For example a folder called frontendfiles
which contains CSS.
I have tried using the StaticFileOptions
like this:
StaticFileOptions staticFileoptions = new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(env.ContentRootPath, "frontendfiles")),
RequestPath = "/frontendfiles"
};
app.UseStaticFiles(staticFileoptions);
app.UseStaticFiles();
When I view the file structure via FTP I can see that the root is wwwroot
, then there is another wwwroot
inside which is generated by the pipeline.
The frontendfiles
folder sits under the root wwwroot
folder, but outside the wwwroot
sub folder.
I have spent days trying to figure this out without success so hoping someone might point me in the right direction.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744895433a4599667.html
评论列表(0条)