简体   繁体   English

如何在VS2012中使用App_data中的Sql Server Compact文件将网站部署到Windows Azure

[英]How to Deploy a website to Windows Azure with Sql server Compact file in App_data in VS2012

I need a help to Deploy my Website on Windows Azure. 我需要帮助以在Windows Azure上部署我的网站。 I have a Database CodeCamper.sdf file in my App_data folder which is working good but i do not know how to deploy that application in Windows Azure and what will be my Connectionstring in that case. 我的App_data文件夹中有一个Database CodeCamper.sdf文件,该文件运行良好,但我不知道如何在Windows Azure中部署该应用程序,在这种情况下我的Connectionstring是什么。 Currently i have no connectionstring in my web.config file. 目前,我的web.config文件中没有连接字符串。 Here is my code 这是我的代码

public CodeCamperDbContext()
        : base(nameOrConnectionString: "CodeCamper") { }

    static CodeCamperDbContext()
    {
        Database.SetInitializer<CodeCamperDbContext>(null);
    }

You just need to make sure that the data files have their " Copy to output directory " property set to something other than "Never". 您只需要确保数据文件的“ 复制到输出目录 ”属性设置为“从不”以外的其他属性。

Here's How to Deploy an Azure Website 这是部署Azure网站的方法

Based on this article (below), it doesn't sound like you need to change anything in the web.config. 根据本文(如下),听起来好像不需要更改web.config中的任何内容。

Using SQL Server Compact for ASP.NET Web Applications 将SQL Server Compact用于ASP.NET Web应用程序

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

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