I am calling a FileResult action like this:
[AllowAnonymous]
public FileResult DownloadDocument(int documentId){// My code}
But it keeps redirecting to Account/Login, I dont even have a Login page.
This is only happening when I deploy the application to my Server (Windows Server 2016 IIS Version 10).
Is there some configuration that I need to use to avoid this issue?
Is the anonymous authentication activated?
On IIS Manager, if your website node is selected, you will find an Authentication button. It is usually in IIS section. If you click on it, you will have an Authentication page.
On this page you will have a list of authentication installed. (like Windows, Form, etc.) You will also have the Anonymous Authentication node.
You'll need to activate it.
Actions are on the right panel.