VisualStudio 2013 Project with SQL 2012 LocalDB

Hi All,

I have a WPF/C# project created in VS2013.  I created a .mdf file, SQL 2012 LocalDB, and the project uses this database perfectly.  I package it up, using InstallShield. 

I goto a fresh machine.  Install SQL Express 2012 LocalDB, (33mb File).

Install my application.

When I goto run the application it presents an error message,

Your SQL Server installation is either corrupt or has been tampered with (Unknown package id).  Please uninstall then re-run setup to correct this problem.

Anybody have this same issue, and if so what is the solution.

July 21st, 2015 2:46pm

Hi TPolo,

Based on my research, the issue could be caused by that the computer name was changed or SQL Server instance was started without using the instance name.

In your scenario, please uninstall and re-install SQL Server LocalDB and check if the issue still occurs. Also make sure that the connection string that points to SQL Server is correct.

There is a similar thread for your reference.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/a72a02e7-fe7e-4c93-8d88-ee556c385d5e/your-sql-server-installation-is-either-corrupt-or-has-been-tampered-with-unknown-package-id?forum=sqlgetstarted

Thanks,
Lydia Zhang

If you have any feedback on our support, please click here.

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 11:27pm

Hi Lydia,

Thank you for the response.  The problem is that I have created a project with a mdf file attached.  So when the user installs the application the default connection string is this:

<connectionStrings>
    <add name="MyCarsDBEntities" connectionString="metadata=res://*/Data.MyCarsDataModel.csdl|res://*/Data.MyCarsDataModel.ssdl|res://*/Data.MyCarsDataModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\Data\MyCarsDB.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;"
      providerName="System.Data.EntityClient" />
  </connectionStrings>

I'm just trying to use the portable version of SQL Express 2012 LocalDB. 

I'm downloading SQL Express 2012 LocalDB from here:

http://www.microsoft.com/en-us/download/details.aspx?id=29062

Thanks Much

July 22nd, 2015 2:23pm

Hi All,

I have a WPF/C# project created in VS2013.  I created a .mdf file, SQL 2012 LocalDB, and the project uses this database perfectly.  I package it up, using InstallShield. 

Where does the mdf file locate? On your new machine? Confirm the file path in your connection string. How about reinstalling sql localdb?
Free Windows Admin Tool Kit Click here and download it now
July 24th, 2015 1:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics