如何在Azure上部署API C#,并且在发布中没有实体框架迁移?

发布于 2025-02-12 18:19:11 字数 114 浏览 0 评论 0原文

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

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白龙吟 2025-02-19 18:19:11

请检查我的解决方法是否有助于解决问题:
构建Web应用程序并连接到Azure SQL数据库服务器时,需要在项目中连接SQL Server Entity框架。

我已经运行了类似的命令,例如

dotnet tool install --global dotnet-ef

无法正常工作,并且无法恢复工具软件包,dotnet-ef无法安装,许多其他错误。

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

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

类似地,根据您对实体框架版本和项目中的dotnet版本的要求,请使用该命令使用版本控制来解决问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文