locked
Portable App with Database RRS feed

  • Question

  • I have this problem when publishing and installing my app in another pc.

    This program is a windows application written in c#. This comes with a local db (.mdf)

    I made the Connection String to be relative, that is 

    Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\SampleDb.mdf;Integrated Security=True" providerName="System.Data.SqlClient

    In the publish setting I did not include the SQL Server 2012 Express Local DB.

    Only the .Net Framework 4.7.2 is included.

    Then I encountered this error when running the app in another PC

    error: 52: Unable to locate a Local Database Runtime installation. Verify that  SQL Server Express is properly installed and the Local Database Runtime feature is enabled


    What could I be missing out here. This is my first time publishing an application.

    Thanks for the answer.

    Thursday, December 10, 2020 9:05 AM

All replies

  • In the publish setting I did not include the SQL Server 2012 Express Local DB.

    A installed SQL LocalDB is mandatory to access the MDF database file.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Thursday, December 10, 2020 10:49 AM