redirect loop - Entity Exception was unhandled by user code in Global.asax -
i'm using microsoft sample project entity framework code first;"wingtiptoys". did extracting file , opening solution. project got built got error while running website. stops in line in global.asax , message is: entity exception unhandled user code "the underlying provider failed on open". surprisingly, used sample project couple of days ago , worked fine of sudden error happened though, didnt change in code , fresh downloaded copy same issue.
by way, when browse webpages google chrome error message. "this webpage has redirect loop webpage @ http://"serveraddress"/errorpage.aspx?handler=customerrors%20section%20-%20web.config has resulted in many redirects. clearing cookies site or allowing third-party cookies may fix problem. if not, possibly server configuration issue , not problem computer."
public class global : httpapplication { void application_start(object sender, eventargs e) { // code runs on application startup bundleconfig.registerbundles(bundletable.bundles); authconfig.registeropenauth(); database.setinitializer(new productdatabaseinitializer());
// add administrator. if (!roles.roleexists("administrator")) --- !!!!!!!!!!!!!!!!!!!!!!!!!!error @ line { roles.createrole("administrator"); } if (membership.getuser("admin") == null) { membership.createuser("admin", "pa$$word", "admin@contoso.com"); roles.addusertorole("admin", "administrator");
and below exception details hresult=-2146232060 message=cannot open database "aspnet-wingtiptoys" requested login. login failed. login failed user 'jinx-pc\jinx'. source=.net sqlclient data provider errorcode=-2146232060 class=11 linenumber=65536 number=4060 procedure="" server=(localdb)\v11.0 state=1 stacktrace: @ system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, uint32 waitformultipleobjectstimeout, boolean allowcreate, boolean onlyonecheckconnection, dbconnectionoptions useroptions, dbconnectioninternal& connection) @ system.data.providerbase.dbconnectionpool.trygetconnection(dbconnection owningobject, taskcompletionsource1 retry, dbconnectionoptions useroptions, dbconnectioninternal& connection) @ system.data.providerbase.dbconnectionfactory.trygetconnection(dbconnection owningconnection, taskcompletionsource
1 retry, dbconnectionoptions useroptions, dbconnectioninternal& connection) @ system.data.providerbase.dbconnectionclosed.tryopenconnection(dbconnection outerconnection, dbconnectionfactory connectionfactory, taskcompletionsource1 retry, dbconnectionoptions useroptions) @ system.data.sqlclient.sqlconnection.tryopen(taskcompletionsource
1 retry) @ system.data.sqlclient.sqlconnection.open() @ system.data.entityclient.entityconnection.openstoreconnectionif(boolean opencondition, dbconnection storeconnectiontoopen, dbconnection originalconnection, string exceptioncode, string attemptedoperation, boolean& closestoreconnectiononfailure) innerexception:
Comments
Post a Comment