3

I receive an SQLite exception when creating a connection.

This worked before I installed VS2015 RTM.

Client (PCL):

 _databaseConnection = DependencyService.Get<IDatabase>().Connect();

Android project:

 public SQLiteConnection Connect()
 {
    var fileName = "my_file.db3";
    var documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
    var path = Path.Combine(documentsPath, fileName);
    var connection = new SQLiteConnection(path);

    return connection;
 }

I receive an exception when executing:

 var connection = new SQLiteConnection(path);

Something went wrong in the build configuration. This is the bait assembly, which is for referencing by portable libraries, and should never end up part of the app.

NOTE:

SQLitePCL.raw_basic is on 0.7.1 I get errors whenever I attempt to upgrade the version to 0.8.1

Again, this all worked before I installed VS2015 RTM Any suggestions?

1
  • Which SQLite-NET nuget are you using? There are a few similarly named packages, so it's good to know. I recommend this one: nuget.org/packages/sqlite-net-pcl Did you update anything else when you upgraded to VS2015, or change the PCL profile being used... it kinda sounds like the project type is no longer one supported by the nuget. Commented Jul 30, 2015 at 2:05

1 Answer 1

2

You need to initialize a new connection and you will need an ISQLitePlatform implementation.

var platform = new SQLitePlatformAndroid();
var connection = new SQLiteConnection(platform, path);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.