跟蹤此博客與步驟,步驟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.