ASP.NET:如何部署的App_Data到虚拟主机提供商? [英] ASP.NET: How to deploy App_Data to webhost?

查看:209
本文介绍了ASP.NET:如何部署的App_Data到虚拟主机提供商?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经上传我的网站我的网站托管商,除了形式authorication它的伟大工程。当我尝试登录时出现此错误:

I have uploaded my website to my webhost and it works great except the form authorication. When i try to login at get this error:

建立SQL Server的连接时发生网络相关的或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server配置为允许远程连接。 (提供者:SQL网络接口,错误:26 - 错误定位服务器/实例指定)

在我的网站我发布从Visual Studio到本地文件夹,然后通过一个FTP客户端程序上传到虚拟主机提供商部署。这里的问题是,App_Data文件夹为空时,我的网站发布到我的本地文件夹。难道这是问题吗?

When i deploy the website i publish it from Visual Studio to a local folder and then upload it to the webhost via a FTP client program. The problem here is that the App_Data folder is empty when i publish the website to my local folder. Could this be the problem?

推荐答案

检查您的服务器允许运行用户实例。如果允许,那么你不需要做任何事情,只需上传MDF文件到服务器上的App_Data文件夹,你是好去。您还可以APP_DATA的发布,它会自动回升App_Data文件夹的内容一起。

Check if your server allows to run user instances. If it allows then you need not do anything and just upload the MDF file to the App_Data folder on the server and you're good to go. You can also include App_data for publish which will automatically pick-up the App_Data folder along with the content.

如果您的服务器不允许用户实例,那么你需要执行以下步骤。

If your server does not allow user instances then you need to perform following steps..

,请联系管理员给你访问凭据沿SQLServer数据库。

Ask admin to give you a SQLServer database along with access credentials.

从您的Visual Studio中右键单击从服务器资源管理器数据库,并选择发布到提供商的选项。按照向导的步骤,有或没有默认的数据生成的SQL脚本。

From your Visual Studio right click on your database from the server explorer and select the option to PUBLISH TO PROVIDER. Follow the wizard steps and generate the SQL script with or without default data.

从Management Studio连接到您的远程SQL Server和运行由管理员提供的数据库上生成的SQL脚本。

Connect to your Remote SQL Server from management studio and run the generated SQL script on the database given by your admin.

更新您的应用程序部署的连接字符串。

Update the connection string in your application for deployment.

这篇关于ASP.NET:如何部署的App_Data到虚拟主机提供商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆