c# - EdmMetadata error only in Azure Compute Emulator -
c# - EdmMetadata error only in Azure Compute Emulator -
i'm having problem getting application run within azure compute emulator. i'm using entity framework 6.0-pre2 , when application runs, next error:
invalid object name dbo.edmmetadata
the database created code first migrations. using same connection information, if runs within regular console application or asp.net mvc 4 website, works correctly.
relevant app.config sections:
<section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> <connectionstrings> <add name="applicationservices" connectionstring="data source=localhost;initial catalog=database;integrated security=true" providername="system.data.sqlclient" /> </connectionstrings> <entityframework> <defaultconnectionfactory type="system.data.entity.infrastructure.localdbconnectionfactory, entityframework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultconnectionfactory> </entityframework> i've verified dbcontext using right connection string with
string connection = db.database.connection.connectionstring; is there reason happening when start task in emulator (and when deploy azure)?
outer exception stack trace:
at system.data.entity.core.entityclient.internal.entitycommanddefinition.executestorecommands(entitycommand entitycommand, commandbehavior behavior) @ system.data.entity.core.objects.internal.objectqueryexecutionplan.execute[tresulttype](objectcontext context, objectparametercollection parametervalues) @ system.data.entity.core.objects.objectquery`1.getresults(nullable`1 formergeoption) @ system.data.entity.core.objects.objectquery`1.<system.collections.generic.ienumerable<t>.getenumerator>b__0() @ system.lazy`1.createvalue() @ system.lazy`1.lazyinitvalue() @ system.data.entity.internal.lazyenumerator`1.movenext() @ system.linq.enumerable.firstordefault[tsource](ienumerable`1 source) inner exception stack trace:
at system.data.sqlclient.sqlconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean asyncclose) @ system.data.sqlclient.tdsparser.tryrun(runbehavior runbehavior, sqlcommand cmdhandler, sqldatareader datastream, bulkcopysimpleresultset bulkcopyhandler, tdsparserstateobject stateobj, boolean& dataready) @ system.data.sqlclient.sqldatareader.tryconsumemetadata() @ system.data.sqlclient.sqldatareader.get_metadata() @ system.data.sqlclient.sqlcommand.finishexecutereader(sqldatareader ds, runbehavior runbehavior, string resetoptionsstring) @ system.data.sqlclient.sqlcommand.runexecutereadertds(commandbehavior cmdbehavior, runbehavior runbehavior, boolean returnstream, boolean async, int32 timeout, task& task, boolean asyncwrite) @ system.data.sqlclient.sqlcommand.runexecutereader(commandbehavior cmdbehavior, runbehavior runbehavior, boolean returnstream, string method, taskcompletionsource`1 completion, int32 timeout, task& task, boolean asyncwrite) @ system.data.sqlclient.sqlcommand.runexecutereader(commandbehavior cmdbehavior, runbehavior runbehavior, boolean returnstream, string method) @ system.data.sqlclient.sqlcommand.executereader(commandbehavior behavior, string method) @ system.data.sqlclient.sqlcommand.executedbdatareader(commandbehavior behavior) @ system.data.common.dbcommand.executereader(commandbehavior behavior) @ system.data.entity.core.entityclient.internal.entitycommanddefinition.executestorecommands(entitycommand entitycommand, commandbehavior behavior)
this happens because ef checking whether edmmetadata table exists in db upgrade/backwards compat scenarios. exception handled ef should not see unless have "break when exception thrown" alternative turned on. alternative turned on exception breaks execution - if handled , never reaches code. can press go on continue execution or disable breaking on first chance exceptions. here thread more details: invalid object name 'dbo.__migrationhistory' using database.create; ef6.02 when connection string passed in
c# entity-framework azure
Comments
Post a Comment