Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ASP.NET Core - Local SQL Database (Instance failure)

$
0
0

Hello
I'm developing a site with ASP.NET Core that works perfectly in my development environment. But once I install it on my production server I have a problem with my database.

After having change the connection information to the database, I encounter an error of the type "Instance failure" (http://dezeiraud.com/). This concerns only my DbContext because EntityFramework connects correctly to my database and works (the connection and registration to the site is possible without problems).
I don't understand why with the same information works on one side and not the other side.

My server run on Windows Server 2012 and the Database is SQL Express 2012. The database is local.
I activated the mode of development on the server in order to have more information about the error but without success...

appsettings.json

{"ConnectionStrings": {"DefaultConnection": "Data Source=VPS-16772\\SQLEXPRESS;Initial Catalog=gaetan-dezeiraud;User ID=#;Password=#;Trusted_Connection=True;MultipleActiveResultSets=true"
  },"Logging": {"IncludeScopes": false,"LogLevel": {"Default": "Debug","System": "Information","Microsoft": "Information"
    }
  }
}


SiteDbContext.cs

namespace DezeiraudWebSite.Models
{
    public class SiteDbContext : DbContext
    {
        //Blog
        public DbSet<BlogArticle> BlogArticle { get; set; }

        //Portfolio
        public DbSet<PortfolioProject> PortfolioProject { get; set; }
        public DbSet<PortfolioCategory> PortfolioCategory { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer(@"Data Source=VPS-16772\\SQLEXPRESS;Initial Catalog=gaetan-dezeiraud;User ID=#;Password=#;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
        }
    }
}

I apologize for my bad English.

Thank you for your answers,
Best regards.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>