本文介绍了如何(SQL 2008)迁移现有的ASP.NET MVC 3项目与.MDF文件到Windows Azure仿真器(使用SQL Azure的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2010中存在的项目,ASP.NET MVC 3与现有数据库的使用密度纤维板(SQL 2008前preSS)。做一些google搜索后,我糊涂了,因为有这么多的资源。你能帮我指着我的简单教程链接?

I have existing project in Visual Studio 2010, ASP.NET MVC 3 with existing database using .mdf (SQL 2008 Express). After doing some googling, I got confused because there are so much resources. Could you help me pointed me out the straightforward tutorial link?

推荐答案

首先是大问题,你将有部分工作来完成这一切。下面的步骤写有理解,你有Windows Azure订阅,并有ASP.net,MVC,SQL和VS2010的基本的了解。

First of all it is large question and you will have to work in parts to get everything done. The following steps are written with understanding that you do have Windows Azure subscription and have basic understanding of ASP.net, MVC, SQL and VS2010.

第1步:安装的Windows Azure SDK 1.6
<一href=\"http://go.microsoft.com/fwlink/?LinkID=234939&clcid=0x409\">http://go.microsoft.com/fwlink/?LinkID=234939&clcid=0x409

Step 1: Install Windows Azure SDK 1.6http://go.microsoft.com/fwlink/?LinkID=234939&clcid=0x409

第2步:在那之后,打开您的应用程序MVC3,当你右击解决方案,你会发现一个新的选项为添加Windows Azure的部署项目,选中它

Step 2: After that, open your MVC3 application and when you right click on solution you will find a new option as "Add Windows Azure Deployment Project", select it.

您将看到一个新的Windows Azure项目在您的解决方案的名称your_application_name.Azure(默认)创建创建。此时如果你让Azure项目作为你的的启动应用程序并运行它这个时候,你MVC3应用程序将在Windows Azure计算模拟器中运行。让SQL Server相关的code完整,您的code居然会与现有的SQL Server工作。

You will see a new Windows Azure project is created in your solution name your_application_name.Azure (default) is created. At this time if you make Azure project as your "Startup" application and run it, your MVC3 application will run inside Windows Azure Compute Emulator. Lets the SQL server related code intact and your code actually will work with existing SQL server.

第3步:验证code任何问题并解决它。请务必计算仿真测试,这是请了解服务配置和使用Windows Azure项目服务定义的时间。

Step 3: Verify your code for any problem and fix it. Be sure to test in Compute Emulator and this is the time please learn about Service Configuration and Service Definition with your Windows Azure project.

第4步:一旦你有你的应用MVC3在计算模拟器中工作,继续前进,只需更换SQL服务器到SQL Azure上。按照一步一步的细节在这里:

Step 4: Once you have your MVC3 application working in compute emulator, go ahead and just replace SQL server to SQL Azure. Follow the step by step details here:

第五步:一旦你的SQL Azure的配置你只(只)需要改变你的连接字符串在web.config中,指向SQL Azure上。

Step 5: Once your SQL Azure is configured you just (ONLY) need to change your Connect String in web.config, pointing to SQL Azure.

http://msdn.microsoft.com/en-us/library/windowsazure/ee336282

第六步:现在,如果你在运行计算仿真的MVC3的应用程序,你可以验证它连接到SQL Azure和验证一切都很好。

Step 6: Now if you run your MVC3 application in Compute Emulator, you can verify that it does connect to SQL Azure and verify all is well.

第7步:最后,现在打包应用程序,并部署到Windows Azure部署和最终测试。一步一步的细节都设在这里:

Step 7: Finally now package your application and deploy to Windows Azure for deployment and final test. The step by step details are located here:

http://msdn.microsoft.com/en-us/spazuretrainingcourse_introtowindowsazurelabvs2010_topic4#_Toc297905245

步骤0:如果你有时间,我建议在下面的链接了解大多数关于MVC,ASP.NET Web角色,SQL Azure和部署进程的基本信息描述您先完成这项工作:
https://www.windowsazure.com/en-us/develop/net/tutorials/web-app-with-sql-azure/

Step 0: If you have time I would suggest you to finish this exercise first as described in the link below to understand most of the basic information about MVC, ASP.NET Web Role, SQL Azure and Deployment process:https://www.windowsazure.com/en-us/develop/net/tutorials/web-app-with-sql-azure/

这篇关于如何(SQL 2008)迁移现有的ASP.NET MVC 3项目与.MDF文件到Windows Azure仿真器(使用SQL Azure的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 18:56