繁体   English   中英

如何在 azure 上部署 api c# 并且发布时没有实体框架迁移?

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

我正在尝试在主机服务上发布 api c#。 我尝试使用 Microsoft azure。 api 已发布,但我可以获取或发布数据。 我发现我在发布中找不到实体框架迁移选项,所以我认为这可能是问题所在。 我需要知道如何找到这个选项。

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.

我已经运行了类似的命令

dotnet tool install --global dotnet-ef

这不起作用并引发错误,例如该tool package cannot be restored并且dotnet-ef安装失败,还有许多其他错误。

当我再次运行相同的命令但使用显式版本控制时,它可以工作:

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

同样,根据您对项目中实体框架版本和 dotnet 版本的要求,使用有助于解决问题的版本控制运行该命令。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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