我有一个 APS.net MVC 项目,已经发布到 azure 一段时间了。我最近更换了笔记本电脑并迁移到 SQL Server 2014。现在,当我尝试发布时,出现 3 个错误。第一个看起来是根类(class):
Error 3 .Net SqlClient Data Provider: Msg 2812, Level 16, State 62, Line 1 Could not find stored procedure 'sp_addextendedproperty'
另外两个错误是:
Error 4 Script execution error. The executed script:
EXECUTE sp_addextendedproperty @name = N'MS_DiagramPane1', @value = N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties =
Begin PaneConfigurations =
Begin PaneConfiguration = 0
NumPanes = 4
Configuration = "(H (1[40] 4[20] 2[20] 3) )"
End
Begin PaneConfiguration = 1
NumPanes = 3
Configuration = "(H (1 [50] 4 [25] 3))"
End
Begin PaneConfiguration = 2
NumPanes = 3
Configuration = "(H (1 [50] 2 [25] 3))"
End
Begin PaneConfiguration = 3
NumPanes = 3
Configuration = "(H (4 [30] 2 [40] 3))"
End
Begin PaneConfiguration = 4
NumPanes = 2
Configuration = "(H (1 [56] 3))"
End
Begin PaneConfiguration = 5
NumPanes = 2
Configuration = "(H (2 [66] 3))"
End
Begin PaneConfiguration = 6
NumPanes = 2
Configuration = "(H (4 [50] 3))"
End
Begin PaneConfiguration = 0 0 AMScan
和
Error 5 Web deployment task failed. (Could not deploy package.
Warning SQL0: A project which specifies SQL Server 2014 as the target platform may experience compatibility issues with Microsoft Azure SQL Database.
Error SQL72014: .Net SqlClient Data Provider: Msg 2812, Level 16, State 62, Line 1 Could not find stored procedure 'sp_addextendedproperty'.
Error SQL72045: Script execution error. The executed script:
EXECUTE sp_addextendedproperty @name = N'MS_DiagramPane1', @value = N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties =
Begin PaneConfigurations =
Begin PaneConfiguration = 0
NumPanes = 4
Configuration = "(H (1[40] 4[20] 2[20] 3) )"
End
Begin PaneConfiguration = 1
NumPanes = 3
Configuration = "(H (1 [50] 4 [25] 3))"
End
Begin PaneConfiguration = 2
NumPanes = 3
Configuration = "(H (1 [50] 2 [25] 3))"
End
Begin PaneConfiguration = 3
NumPanes = 3
Configuration = "(H (4 [30] 2 [40] 3))"
End
Begin PaneConfiguration = 4
NumPanes = 2
Configuration = "(H (1 [56] 3))"
End
Begin PaneConfiguration = 5
NumPanes = 2
Configuration = "(H (2 [66] 3))"
End
Begin PaneConfiguration = 6
NumPanes = 2
Configuration = "(H (4 [50] 3))"
End
Begin PaneConfiguration =
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_METHOD.) 0 0 AMScan
经过一些研究,我了解到 2014 年有某些扩展存储过程在 Azure SQL 中不可用,但许多早期版本(包括我之前使用的 2012 年)似乎都是这种情况。
关于如何解决这个问题的任何想法。
干杯, 凯文.
最佳答案
有multiple options可供您使用,但我认为以下 2 个最能满足您的需求:
- 集成在 Visual Studio 中,您拥有 SQL Server Data Tools 。当您将部署目标切换到 Azure SQL DB 时,您将获得不兼容性列表,然后您可以在项目中修复该列表。
有关如何使用 SSDT 将数据库移动到 Azure 的详细信息:https://msdn.microsoft.com/en-us/library/azure/jj156163.aspx - 使用SQL Server Migration Wizard 。该工具将检查您的数据库,允许您选择要迁移的项目,然后为您生成迁移脚本。
有关如何使用它的更多详细信息: http://blogs.msdn.com/b/prasanna/archive/2015/04/13/migrating-sql-server-on-premise-db-to-sql-azure-using-sql-server-migration-wizard.aspx和 https://msdn.microsoft.com/en-us/library/azure/jj156166.aspx
关于asp.net - 2014 更新后无法发布到 Azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30929969/