I am using SQLite in an Asp.Net MVC 5 project, which works fine.
I downloaded the application in Microsoft Azure and received the following error:
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)
In Azure, I added the following connection string:
Data Source=D:\home\site\wwwroot\Data\MyDatabase.sqlite;Password=pass
Since there is no SqlLite database database, I chose Custom:

I checked using Azure Kudu and the file is in the correct path ...
However, when I run the application, I get an error all the time.
Does anyone know how to solve this?
UPDATE
The My Entity Framework class is as follows:
[DbConfigurationType(typeof(Configuration))]
public class Context : DbContext, IDbContext {
public Context() {
Configuration.With(x => {
x.AutoDetectChangesEnabled = true;
x.LazyLoadingEnabled = false;
x.ProxyCreationEnabled = true;
x.ValidateOnSaveEnabled = true;
});
}
public DbSet<Post> Posts { get; set; }
public DbSet<Tag> Tags { get; set; }
protected override void OnModelCreating(DbModelBuilder builder) {
}
}
public class Configuration : DbConfiguration {
public Configuration() {
SetDatabaseInitializer<Context>(null);
SetProviderServices(SqlProviderServices.ProviderInvariantName, SqlProviderServices.Instance);
}
}
And I have the following in Global.asax:
AppDomain.CurrentDomain.SetData("DataDirectory", AppDomain.CurrentDomain.BaseDirectory + "Data");
builder.RegisterType<Context>().As<IDbContext>().InstancePerRequest();
Connection string in Web.Config:
<connectionStrings>
<add name="Context" providerName="System.Data.SQLite" connectionString="Data Source=|DataDirectory|\MyDatabase.sqlite;Version=3;Password=pass" />
</connectionStrings>