我有点卡在这里,在部署之后似乎无法使我的数据库在Azure上工作,但是在我的本地计算机上一切正常。
到目前为止我所做的是:
1) Logged into Azure
2) Created a website
3) Created a Database
4) Downloaded the 'Publish Profile' file
5) Enabled migrations on my App
7) Removed my DbContext class - NEVERMIND, I kept it. I removed the store initializer.
6) App > Publish > Import > (imported the publish profile)
但是,当我转到Settings并检查ApplicationDbContext时,它的空白。此外,当我在推送到云端后访问该网站时,我得到了:
[Win32Exception (0x80004005): The system cannot find the file specified]
...这是预期的,因为数据库未正确连接。
任何想法都将不胜感激。
编辑:
ApplicationDbContext类如下:
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext() : base("DataContext") { }
public DbSet<Program> Programs { get; set; }
public DbSet<Course> Courses { get; set; }
public DbSet<Suggestion> Suggestions { get; set; }
public DbSet<FollowUp> FollowUps { get; set; }
public System.Data.Entity.DbSet<Suggestions.Controllers.SuggestionBase> SuggestionBases { get; set; }
}