user4594264
user4594264

Reputation:

ASP.NET web app works in localhost but not on Azure

My ASP.NET web app is working 100% in localhost, but in Azure, one of the pages isn't working. It's displaying this error:

500 Internal server error Web server cannot perform this request. Please try again later.

In LogFiles > DetailedErrors it shows nothing helpful to solve this problem. I read some solutions from similar problems on this site, but they not working in my case.

Note: my web app doesn't have a database. The difference between the page that doesn't work and other pages is that it uses a Nuget selectPdf community version.

Upvotes: 1

Views: 1323

Answers (2)

Lauren Tran
Lauren Tran

Reputation: 36

Usually, when something is working in localhost, but not on Azure after you've deployed it, it's because the Azure box that the code you've deployed to does not have all the dependencies installed that your app needs. You'll need to go into the console of the machine (inside the management portal or via remote desktop), and install all dependencies required. Some come native but others need to be manually installed.

Upvotes: 0

theadriangreen
theadriangreen

Reputation: 2258

It looks like the SelectPdf package calls into APIs restricted by the App Service sandbox. Most PDF rendering engines use GDI+, which has most functionality restricted by the Azure App Service sandbox. However, this policy is relaxed on dedicated servers. Scaling up to a dedicated server should resolve this problem (i.e. not the Shared or Free SKU).

Upvotes: 1

Related Questions