Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
423 views
in Technique[技术] by (71.8m points)

asp.net core - FastReport aspcore 404 error in production /_fr path unavailable

We are running into an error when trying to deploy our asp.net core application to production with FastReport. It seems that when the report preview is generated, it creates a bunch of resource and file system links to the path /_fr

When we deploy the application on IIS in production, the application lives in a folder structure of its own: http://www.ourdomain.com/OurApp (C:inetpubOurApp)

The application pool for the application doesn't have access to the root folder under inetpub. When generating a report for preview, FastReport tries to write all of these resources to C:inetpub\_fr... and the URLs used to access these resources are

http://www.ourdomain.com/_fr/resources.getResource?resourceName=magnifier.svg&contentType=image%2Fsvg%2Bxml http://www.ourdomain.com/_fr/resources.getResource?resourceName=spinner.svg&contentType=image%2Fsvg%2Bxml http://www.ourdomain.com/_fr/resources.getResource?resourceName=reload.svg&contentType=image%2Fsvg%2Bxml http://www.ourdomain.com/_fr/preview.getReport?reportId=b43add31c4b64cc0a111ded240c9b565&renderBody=yes

We've tried changing the ROOT_BASE_PATH but it doesn't seem to help.

There's no problem if we export straight to PDF. It is only an issue with the preview function.

@if (ViewBag.WebReport != null)
    {
        @await ViewBag.WebReport.Render();
    }

Any insight to this issue would be helpful. We can't find documentation that explains how the preview is actually supposed to work

question from:https://stackoverflow.com/questions/65924920/fastreport-aspcore-404-error-in-production-fr-path-unavailable

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think this is an error caused by permissions, First of all, shouldn't the App be under wwwroot? You can try to move your "OurApp" to the wwwroot folder and try again. Then check if the IIS_IUSRS has permission for the wwwroot folder. By default, the IIS user does not have write permissions for the wwwroot folder.

1.Open File Explorer and go to C:/inetpub/

2.Right click on wwwroot and click on "Properties"

3.Go to the Security tab and click "Edit..." to edit permissions

4.Find and select the IIS user. In my case, it was called IIS_IUSRS ([server name]IIS_IUSRS).

5.Select the "Allow" checkbox for all permissions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...