跟踪此博客与步骤,步骤http://www.windowsazure.com/en-us/documentation/articles/web-sites-dotnet-deploy-aspnet-mvc-app-membership-oauth-sql-database/#setupdevenv的Windows Azure - 迁移为背景“ApplicationDbContext”
如果我从我的本地机器上运行的话,我看这是从Windows Azure的分贝来的数据,我可以添加和启用更新或删除...完美的工作正常,但问题是当我发布我的应用程序到Windows Azure,我能够看到我的页面和所有的静态页面工作正常,但除了与数据库交互的一个页面。
这里是我的web.config中的连接字符串:
<add name="DefaultConnection" connectionString="server=tcp:* insert server name*.database.windows.net,1433;Database=* insert database name *;User ID=*insert username *@* insert server name*;Password={*insert password here *};Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" />
我得到这个消息时,我尝试从http://XXXX.azurewebsites.net/Employee
错误信息访问网页:
Migrations is enabled for context 'ApplicationDbContext' but the database does not exist or contains no mapped tables. Use Migrations to create the database and its tables, for example by running the 'Update-Database' command from the Package Manager Console.