简体   繁体   中英

How to deploy api c# on azure and there is no entity framework migration in publish?

I am trying to publish the api c# on a host service. I tried using Microsoft azure. The api is published but I can get or post the data. I figured out that I couldn't find the entity framework migration option in the publish, so I thought this might be the problem. I need to know how to find this option.

Please check if my workaround helps to fix the issue: when building the Web Application and connecting to the Azure SQL database server, there is a need of connecting SQL Server Entity framework in my project.

I have run similar command like

dotnet tool install --global dotnet-ef

which was not working and throwing the error like that tool package cannot be restored and dotnet-ef failed to install, many other errors.

When I run the same command again but with explicitly versioning, then it is worked:

dotnet tool install --global dotnet-ef --version 5.0.1

Similarly, based on your requirement of the entity framework version and the dotnet version in the project, run that command using versioning which helps to fix the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM