简体   繁体   English

如何使用数据库部署ASP.NET MVC 4应用程序?

[英]How to deploy an asp.net mvc 4 application with database?

I'm new to asp.net and want to do the following: 我是asp.net新手,并希望执行以下操作:

I have an asp.net mvc 4 website that uses a local database (mdf). 我有一个使用本地数据库(mdf)的asp.net mvc 4网站。 I want to install that website on a windows 2012 server (amazon ec2). 我想在Windows 2012服务器(amazon ec2)上安装该网站。

My Questions: 我的问题:

  • How do I handle the database? 如何处理数据库?
  • How do I move it onto the server? 如何将其移动到服务器上?

There are several steps: 分几个步骤:

  • According to Microsoft ( http://msdn.microsoft.com/en-us/library/dd410407(v=vs.90).aspx ), you should publish first your website to a local folder; 根据Microsoft( http://msdn.microsoft.com/en-us/library/dd410407 ( v=vs.90 ) .aspx )的介绍,您应该首先将网站发布到本地文件夹中; you can embark your database by clicking Include files from the App_Data folder . 您可以通过单击Include files from the App_Data folder数据库。
  • You will transfer your published folder to your Windows 2012 in, for example, a subfolder of c:\\inetpub\\wwwroot . 您将发布的文件夹转移到Windows 2012中,例如,在c:\\inetpub\\wwwroot的子文件夹中。
  • You will have to create a new Web Site in IIS (I'll let you search by yourself ;-) ) 您将必须在IIS中创建一个新的网站(我会让您自己搜索;-))

Note: I am not that familiar with mdf files, but you will certainly have to modify your web.config , to point to the actuel path of the mdf file ( c:\\inetpub\\wwwroot\\MY_SITE\\AppData\\MYDATABASE.mdf ). 注意:我对mdf文件不是很熟悉,但是您肯定需要修改web.config ,以指向mdf文件的actuel路径( c:\\inetpub\\wwwroot\\MY_SITE\\AppData\\MYDATABASE.mdf )。

Note: Also, the IIS User account should have the right to write the database; 注意:此外,IIS用户帐户应有权写入数据库; so the folder c:\\inetpub\\wwwroot\\MY_SITE\\AppData\\ should have its security modified accordingly (right click, Properties / Security ) to add the IIS User (as this is the account that should run the Web Site). 因此,应该相应地修改文件夹c:\\inetpub\\wwwroot\\MY_SITE\\AppData\\的安全性(右键单击Properties / Security )以添加IIS用户(因为这是应该运行网站的帐户)。

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

相关问题 如何将Mono ASP.NET MVC应用程序部署到XSP? - How to deploy mono ASP.NET MVC application to xsp? 如何部署ASP.NET MVC3应用程序? - How do I deploy an ASP.NET MVC3 Application? 如何部署具有多个区域的asp.net mvc 4应用程序 - How to Deploy asp.net mvc 4 application having multiple Areas 如何在ASP.NET MVC应用程序中部署更新 - How to deploy updates in asp.net mvc application ASP.NET MVC 部署 - ASP.NET MVC DEPLOY ASP.NET MVC 3 - 如果在IIS 7.5上部署为应用程序,则找不到图像 - ASP.NET MVC 3 - Images not found if deploy as application on IIS 7.5 部署ASP.Net MVC应用程序的最便宜方式是什么? - What is the cheapest way to deploy an ASP.Net MVC application? 如何使用MS SQL Server数据库发布和部署Asp.net核心数据库优先应用程序 - How to publish and deploy an Asp.net Core Database first application with MS SQL Server Database 如何将带有devexpress组件的ASP.NET MVC应用程序部署到Azure网站 - How to deploy ASP.NET MVC application with devexpress components to Azure websites 如何在Visual Studio 2015中使用MSBuild在构建上部署ASP.NET MVC应用程序? - How to deploy an ASP.NET MVC application on build using MSBuild in Visual Studio 2015?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM