Hi @JERONIMO Edevaldo,
Did you mean that these code work fine in Visual studio, but not working after published the application in IIS? If this is the case, you have to check the
authentication configuration in IIS as mentioned by Lex Li, otherwise you will get the error code(401.2):
If I misunderstand anything, please let me know.
If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.