I'm trying to deploy my ASP.NET MVC5 website to test following this tutorial: https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis
In the part about "Configure deployment for the application database" point 2, I need to check a box that is not avaible on my screen(Execute Code First Migrations). My problem being the following : I have an onion architecture, hence my project containing the context of Entity Framework is in a separate project (and I'm deploying the asp.net MVC 5 project), so that means I cannot enable-migrations
in this project. I've also changed my connection strings to fit the name of my context as precised in this post : https://stackoverflow.com/a/32866872/4714502 . On the other hand, my DbSet have different names then my Entity Framework classes, would that be an issue? I did this because the syntax of my tables is quite awkward, and was a requirement (I did not want to use this naming convention in my application). Say for a table Web_Documents :
DbSet<Web_Documents> WebDoc { get; set; }
As for the architecture I have :
- Entities (POCO)
- Repository (context is here)
- Service
- UI (MVC) (Deploy here)
Dependencies go from 4 to 1.
And here is my app.config in Repository:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="PrincipalServerContext" connectionString="Data Source=SMRFG12APP13\SQLEXPRESS;Initial Catalog=PrincipalServerDB;Integrated Security=SSPI" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
My db's name is PrincipalServerDB
and the context PrincipalServerContext
Now I'm out of ideas, don't really know what else I can do?