当我在我的 Azure 在线帐户上发布它时它就可以工作,并且数据库运行良好。但问题是,当我按照教程进行操作时,它要求这样做:1. enable-migrations 2. add-migrations 3. update-database
- 和 2. 有效,但是当我在包管理器控制台中运行 3. (update-database) 时,我收到此错误:
数据库“master”中的 CREATE DATABASE 权限被拒绝。
所以我无法在本地部署我的网站,这是我的问题......当我运行 Ctrl+F5 时,它会打开
> http://localhost:2700/
它显示了这个错误:
> Server Error in '/' Application.
>
> CREATE DATABASE permission denied in database 'master'.
>
> Description: An unhandled exception occurred during the execution of
> the current web request. Check the stack trace for more information
> about the error and where it originated in the code.
>
> Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE
> Permission denied in database 'master'.
>
> Source Error:
>
>
> Line 20: public ActionResult Index ()
> Line 21: {
> Line 22: return View(db.ToDoItems.ToList ());
> Line 23: }
>
> Source File: c: \ Users \ baudouin \ Documents \ Visual Studio 2012 \
> Projects \ ToDoListApp \ ToDoListApp \ Controllers \ HomeController.cs
> Line: 22
当我打开 SQL Server Management Studio 时,我确实可以访问我的主数据库......当我在 Visual Studio 2012 RC 中时,它说我的数据连接 DefaultConnection(ToDoApp) 有一个错误:
> Server Explorer can not execute this operation.
> For more information, see details below:
> Cannot attach the file 'C:\Users\baudouin\documents\visual studio 2012\Projects\ToDoListApp\ToDoListApp\App_Data\aspnet-ToDoListApp-20120625114938.mdf'
> as database 'aspnet-ToDoListApp-20120625114938'.
我在教程中没有看到与 .mdf 相对应的内容......而且我不明白为什么 update-database 根本不起作用。
你能帮我么 ?
谢谢 !!【来自巴黎的法国学生】