简体   繁体   English

当我从Visual Studio发布到Azure时,我的数据库没有发布,因此任何需要中断的功能

[英]When I publish from Visual Studio to Azure my database doesn't get published and so any functionality requiring that breaks

I have a C# college project coming up that requires me to build and deploy a C# .NET MVC web application. 我有一个C#学院项目,需要我构建和部署C#.NET MVC Web应用程序。 I have fully built it and it works fine locally but when I deploy to Azure it sends everything except the database. 我已经完全构建它,并且在本地运行良好,但是当我部署到Azure时,它将发送除数据库之外的所有内容。

When I am publishing my project through VS I make sure to copy the connection string from my database in, I test the connection to make sure everything works fine, but when I get to the final 'Publish' screen down at the bottom it does not have any database selected to publish. 当我通过VS发布项目时,请确保复制数据库中的连接字符串,并测试连接以确保一切正常,但是当我到达底部的最终“发布”屏幕时,它并没有选择任何要发布的数据库。 That is unless I tick the box 'Execute code first migrations' and then one will be there at this final screen, however it doesn't seem to actually get published. 除非我在“首先执行代码迁移”框中打钩,然后在最后一个屏幕上出现,否则似乎并没有真正发布。

It's really frustrating me at this point that I have everything make and working just fine locally however this hiccup could cost me the project. 在这一点上,我真的很沮丧,因为我在本地制作的一切都很好,但是打h可能使我付出了很多代价。 Any tips would be much appreciated! 任何提示将不胜感激!

According to your description, I seems that you need to publish the Azure site with local database. 根据您的描述,我似乎需要使用本地数据库发布Azure站点。 If it is that case, I recommond you to use the Azure SQL database. 如果是这种情况,我建议您使用Azure SQL数据库。 You could refer to azure official document Build an ASP.NET app in Azure with SQL Database to get detail steps. 您可以参考azure官方文档使用SQL数据库在Azure中构建ASP.NET应用程序以获取详细步骤。

Related link: 相关链接:

How to publish a website with sql local db database to azure using visual studio 2013 如何使用Visual Studio 2013将具有sql本地db数据库的网站发布到Azure

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

相关问题 在 Visual Studio 中发布 Azure 函数时包含文件 - Including a file when I publish my Azure function in Visual Studio 我的网络应用程序在发布时找不到我的数据库 - My web app doesn't find my database when published 如何从 Visual Studio 将可执行文件发布到我的 Azure Function? - How can I publish an exectuable file to my Azure Function from Visual Studio? 为什么我的visual studio 2015 SQL Server无法与Azure SQL数据库连接? - Why my visual studio 2015 SQL Server doesn't connect with Azure SQL Database? 我的 Visual Studio 脚本不会更改表单中的任何属性 - My visual studio script doesn't change any attributes in the form 为什么Visual Studio 2012不从MySql数据库生成EDM图 - Why doesn't Visual Studio 2012 generate a EDM diagram from my MySql database 如何将已发布的Web应用程序从Azure导入到Visual Studio for Web - How to import a published Web app from azure to visual studio for web 发布时,Visual Studio中的AssemblyName错误 - AssemblyName in Visual Studio error when i publish it 当我关闭 Visual Studio 时,Application_end 事件不会更新数据库 - Application_end event doesn't update the database when I close visual studio 我的横幅广告出现在Visual Studio中,但是当我上传site.master时却没有出现。 为什么是这样? - My banner appears in visual studio, but doesn't appear when I upload the site.master. Why is this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM