Asp.net 部署到Azure后有关Global.asax的问题

Asp.net 部署到Azure后有关Global.asax的问题,asp.net,azure,c#-4.0,web-deployment,global-asax,Asp.net,Azure,C# 4.0,Web Deployment,Global Asax,我已经意识到,在我将我的项目部署到Azure之后。global.asax的连接字符串不起作用,导致我使用sql命令用于功能的页面已消失,无法运行。我怎样才能修好它?经验者能给出如何解决这个问题的方法吗?多谢各位 //connection String public const string CS = @" Data Source=(LocalDB)\mssqllocaldb;AttachDbFilename=|DataDirectory|\MTCompanyDB.mdf

我已经意识到,在我将我的项目部署到Azure之后。global.asax的连接字符串不起作用,导致我使用sql命令用于功能的页面已消失,无法运行。我怎样才能修好它?经验者能给出如何解决这个问题的方法吗?多谢各位

    //connection String
    public const string CS = @"
    Data Source=(LocalDB)\mssqllocaldb;AttachDbFilename=|DataDirectory|\MTCompanyDB.mdf
    ;Integrated Security=True";

Azure的LocalDb不存在。LocalDb是SQL Server Express的一项功能,在您部署应用程序服务网站的服务(计算机)上没有与之等效的功能

您可以在
web.config
中设置connectionstring,并在部署到azure
时创建SQL数据库

发布后,单击
Configure
打开发布设置。

单击
在运行时使用此连接字符串(更新目标web.config)
,当您的webapp部署到Azure时,它将使用Azure sql连接字符串。

有关更多详细信息,请参阅此