locked
Manage.aspx won't work in Azure RRS feed

  • Question

  • User-956690817 posted

    has anyone had problems with the Manage.aspx page in azure I get this

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    if I comment out this in the web.confg

      <entityFramework>    

    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">       <parameters>        

    <parameter value="v11.0" />      

    </parameters>    

    </defaultConnectionFactory>

      </entityFramework>

     

    And this if I uncomment it

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a LocalDB installation. Verify that SQL Server Express is properly installed and that the LocalDB feature is enabled.)

    Every thing else works fine for membership

    Thanks for your help in advance

     

     

    Saturday, September 22, 2012 12:27 AM

All replies

  • User-1007037156 posted

    Can you be more specific on the "manage.aspx" page? Which page is this exactly?

    Monday, September 24, 2012 10:38 AM
  • User-956690817 posted

    Hi thanks for getting back to me it's in the account folder of a default Web site template .Net 4.0 I created a new web site project

    and deplyed it to Azure webstes tired it out every thing seems to work except the functionality on that page

    Monday, September 24, 2012 12:22 PM
  • User455156504 posted

    Hi,

    have you deployed a database along with your website?

    Monday, September 24, 2012 4:18 PM
  • User-956690817 posted

    Yes and it works except the manage.aspx I commented out the default  code in the page load and added a new

    change password controll and is seems to work I can't find anywhere in this code were it hits the wrong data base by default

            protected void Page_Load()
            {
                if (!IsPostBack)
                {
                    // Determine the sections to render
                    var hasLocalPassword = OpenAuth.HasLocalPassword(User.Identity.Name);
                    setPassword.Visible = !hasLocalPassword;
                    changePassword.Visible = hasLocalPassword;
    
                    CanRemoveExternalLogins = hasLocalPassword;
    
                    // Render success message
                    var message = Request.QueryString["m"];
                    if (message != null)
                    {
                        // Strip the query string from action
                        Form.Action = ResolveUrl("~/Account/Manage.aspx");
    
                        SuccessMessage =
                            message == "ChangePwdSuccess" ? "Your password has been changed."
                            : message == "SetPwdSuccess" ? "Your password has been set."
                            : message == "RemoveLoginSuccess" ? "The external login was removed."
                            : String.Empty;
                        successMessage.Visible = !String.IsNullOrEmpty(SuccessMessage);
                    }
                }
    
    
                // Data-bind the list of external accounts
                var accounts = OpenAuth.GetAccountsForUser(User.Identity.Name);
                CanRemoveExternalLogins = CanRemoveExternalLogins || accounts.Count() > 1;
                externalLoginsList.DataSource = accounts;
                externalLoginsList.DataBind();
    
            }

    Monday, September 24, 2012 4:39 PM
  • User-1007037156 posted

    Which version of Visual Studio are you using and is it an RTM version or pre-RTM version? I ask b/c when I look at a v4.0 web site created with Visual Studio 2012 RTM, my web.config for the section you mentioned is a bit different.

    I have:

    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    </entityFramework>



    Tuesday, September 25, 2012 10:07 AM
  • User-956690817 posted

    Hi thanks for getting back to me I have the latest version of VS 2012 but I did have the beta versions

    while they where comming out I might have to do a repair if this is the only cut I get from the beta versions I'm lucky

    I'll try

    Tuesday, September 25, 2012 2:20 PM
  • User-1007037156 posted

    Okay, see if you can upgrade to the RTM version of VS 2012 and then retry your scenario. If it still doesn't work, I can help you debug.

    Wednesday, September 26, 2012 9:57 AM
  • User-956690817 posted

    I did a repair and I still get the same constring I set the default data base connection to XXXX-PC\MSSQLSERVER12 I still get

    connectionString="Data Source=(LocalDb)\v11.0;Initial

    and this


        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v11.0" />
          </parameters>
        </defaultConnectionFactory>

    when I create a .NET 4 app with vs 2010 on the same machine it points to sqlexpress without the connection factory entry

    Wednesday, September 26, 2012 1:51 PM
  • User-1007037156 posted

    Okay, let's go w/ the version of Visual Studio you currently have installed. We need to nail down the line of code that is triggering the database request and failing. In the original Manage.aspx page, can you wrap it in a try/catch, grab the exception and then dump the stack to the page so we can see which line of code is the culprit?

    Thursday, September 27, 2012 9:53 AM
  • User-956690817 posted

    Hi thanks is the exception and the Inner exception I only have one connection string and I'm using code first it's all working

    This is the line of code thst is throwing the exception

    var hasLocalPassword = OpenAuth.HasLocalPassword(User.Identity.Name);

    An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. Begin Inner Exception System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception: The system cannot find the file specified --- End of inner exception stack trace --- at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) at System.Data.SqlClient.SqlConnection.Open() at System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act) at System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) at System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) at System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) --- End of inner exception stack trace --- at System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) at System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)

    Thursday, September 27, 2012 9:40 PM
  • User-1007037156 posted

    Hmm - my guess is that we're trying to connect to a LocalDb server on the Azure machine, but I don't think that's installed.

    Can you replace the <defaultConnectionFactory> value you have in your web.config with what I'm seeing in my VS 2012 RTM install.

    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />

    Let's see if that's the root problem.

    Monday, October 1, 2012 4:49 PM
  • User1732151249 posted

    I know this is a really old thread but I was wondering if there was a resolution for this; I'm having the same exact issue?

    Monday, April 7, 2014 5:27 AM