[Solved] After IIS builds an asp.net core project, other computers cannot access resource files

After IIS builds the asp.net core project, the resource files (pictures, etc.) inside cannot be accessed. The solution is as follows:

1. Check whether the resource files in the asp.net core release file are all placed in the directory named wwwroot.

2. Check that app.UseStaticFiles() is added to the Startup.cs file in the asp.net core project;

 

After checking the above two points, you can then visit to find the resource. There is no need to add wwwroot to the link for ps to access resources.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325122253&siteId=291194637
Recommended