Problem with pubishing net core API into Azure

Abdulrazzak Alsssouki 1 Reputation point
2021-04-26T22:50:04.313+00:00

Hello,
I have a net core 3.1 REST API and I want to publish it into Azure. I started by following this article:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-azure-api-management-using-vs?view=aspnetcore-5.0

When I added Swagger I encountered a problem with a generic error 'HTTP ERRO 550.30' after installing version 3 of the Swashbuckle.AspNetCore package. When I install the last version the API works again locally but I can not publish it into Azure because swagger could not make the swagger JSON file.
I tried many suggestions from GitHub and StackOverflow and nothing worked!
Note: if I moved into version 3.0.0 from the library I can publish the API but end again with 'HTTP ERRO 550.30'

Finally, I encounter today a different error even that I did not change anything on the code which is:
'Web deployment task failed. (Web Deploy cannot modify the file 'BuildingRestAPI.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE. '

I will apprentice any help because I'm running of time for this assignment and I already wasted three days on this problem
Thank you in advance

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,111 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Urnun 9,811 Reputation points Microsoft Employee
    2021-04-30T09:42:36.723+00:00

    Hi anonymous user - Regarding the second error message, have you tried again after removing the lock placed by the external process? There might be a separate running process that needs to be terminated to fix that issue. As for the first one with HTTP ERROR 550.30 error, it's coming from IIS & your asp.net core project configuration and is not something originating from any of the underlying publishing services...Does the project build successfully? Also, any reason for using version 3 of the Swashbuckle package? According to their compatibility table, version 3 is for asp.net core >= 1.0.4, < 3.0.0 but you seem to be running on asp.net core 3.1.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.