entity framework - EF 6 Code based migration exception: Microsoft.VisualStudio.Data.Tools.Package not serializable? -
i have configuration
internal sealed class configuration :dbmigrationsconfiguration<ias.models.applicationdbcontext> { public configuration() { automaticmigrationsenabled = false; contextkey = "ias.models.applicationdbcontext"; } protected override void seed( ias.models.applicationdbcontext context ) { var basedir = appdomain.currentdomain.basedirectory; context.database.executesqlcommand(file.readalltext(basedir + "\\myinsertscriptsql")); } }
when running upate-dataabase following exception
excepción al llamar "setdata" con los argumentos "2": "el tipo 'microsoft.visualstudio.data.tools.package.internal.oaproject' del ensamblado 'microsoft.visualstudio.data.tools.pa ckage, version=11.1.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' no está marcado como serializable." en d:\dev\insuranse advanced services\ias\packages\entityframework.6.0.0\tools\entityframework.psm1: 611 carácter: 20 + $domain.setdata <<<< ('startupproject', $startupproject) + categoryinfo : notspecified: (:) [], methodinvocationexception + fullyqualifiederrorid : dotnetmethodexception system.nullreferenceexception: referencia objeto no establecida como instancia de un objeto. en system.data.entity.migrations.extensions.projectextensions.getprojecttypes(project project, int32 shellversion) en system.data.entity.migrations.extensions.projectextensions.iswebproject(project project) en system.data.entity.migrations.migrationsdomaincommand.getfacade(string configurationtypename, boolean usecontextworkingdirectory) en system.data.entity.migrations.updatedatabasecommand.<>c_displayclass2.<.ctor>b_0() en system.data.entity.migrations.migrationsdomaincommand.execute(action command) referencia objeto no establecida como instancia de un objeto.
problem solved, opened file ..\packages\entityframework.6.0.0\tools\entityframework.psm , line 611 states:
$domain.setdata('startupproject', $startupproject)
i them after review solution found startup project changed database project, corrected , problem gone.
Comments
Post a Comment