none
Failed to connect to any cache. Windows 10, Visual Studio 2013.

    General discussion

  • Setting up a new Windows 10 workstation and cannot run code contracts. Getting a pop-up with "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". Details:

    Windows 10

    Visual Studio 2013 Update 5

    Code Contracts 1.9.10714.2

    This was working on my Windows 7 workstation. Any help is greatly appreciated! Things I have tried:

    * Repairing and removing my SQL Server 2012 installation. 

    * Repairing and removing/reinstalling Visual Studio 2013 Update 5. 

    * Running Visual Studio 2013 as administrator. 

    • Changed type christaylor192 Tuesday, July 17, 2018 10:29 PM Discuss problem
    Tuesday, July 17, 2018 5:05 PM

All replies

  • Turned on -trace:cache and got more info:

    CodeContracts: Avigilon.Manufacturing.Common: [cache] Cannot open cache: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
    CodeContracts: Avigilon.Manufacturing.Common: [cache] Inner Exception: The provider did not return a ProviderManifestToken string.
    CodeContracts: Avigilon.Manufacturing.Common: [cache] Inner Exception: 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: 50 - Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.
    Tuesday, July 17, 2018 10:29 PM
  • Disabling "Cache Results" gets past this problem, although results in very slow builds so I'd like to fix it. 
    Tuesday, July 17, 2018 10:30 PM
  • Works if I enable "Cache Results" and specify my local SQL 2012 named instance (<workstation>\SQL2012). Great! Although that is not going to work for our build machines once upgraded to Windows 10. 

    Does not work if I enable "Cache Results" and specify what I read is the default: (localdb)\v11.0 (from https://stackoverflow.com/a/23450184). 

    I can connect to (localdb)\v11.0 from SSMS using windows authentication. 

    Tuesday, July 17, 2018 10:39 PM
  • OK seem to have it all working again:

    1. Deleted all ccheck databases on (localdb)V11.0

    2. Deleted all files in C:\Users\<user>\AppData\Local\CodeContracts

    3. Enabled Cache Results and cleared SQL Server. 

    Tuesday, July 17, 2018 11:21 PM
  • Spoke too soon. Problem came back. 

    Seems to be an with starting (localdb)V11.0. If I connect to (localdb)V11.0 using SSMS then code contracts can connect to the cache. This points to an issue with starting the (localdb)V11.0 instance. It should start "automatically" when code contracts accesses it. Using SSMS to access (localdb)V11.0 starts it, thus why code contracts can access it. 

    Long story short, probably not a code contracts issue. Leaving this here though incase others have the same issue. It will hopefully save them from reinstalling SQL Server or Visual Studio and losing a day setting them back up. 

    Tuesday, July 17, 2018 11:22 PM
  • The problem turned out to be the minimum version of SQL Server required for Windows 10. See: https://support.microsoft.com/en-us/help/2681562/using-sql-server-in-windows-8-and-later-versions-of-windows-operating

    Visual Studio 2013 update 5 includes SQL Server 2012 Express LocalDB, yet not the SP2 required for Windows 10. 

    Wednesday, July 18, 2018 10:23 PM