What does “The ”DataDirectory“ registry value is m

2020-02-12 06:32发布

问题:

I have a MVC4/ASP.Net application that uses localdb. Everything "appears" to work correctly. However I am getting loads of errors in my event log:

The "DataDirectory" registry value is missing in the LocalDB instance registry key: {BB3F4304-E7E9-4EE7-9A25-B46BFAA73FB4}

The "DataDirectory" registry value is missing in the LocalDB instance registry key: {BB31321B-BEB9-465B-8C8E-DEF9C2C67FBE}

Each time the instance changes.

XML Detail of the error:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="SQLLocalDB 11.0" /> 
    <EventID Qualifiers="35269">512</EventID> 
    <Level>2</Level> 
    <Task>0</Task> 
    <Keywords>0x80000000000000</Keywords> 
    <TimeCreated SystemTime="2013-03-12T14:12:43.000000000Z" /> 
    <EventRecordID>1080755</EventRecordID> 
    <Channel>Application</Channel> 
    <Computer>XXXXXX</Computer> 
    <Security /> 
  </System>
  <EventData>
    <Data>{BB07CF13-2ABD-4FD5-AB2B-467FF08F28E6}</Data> 
  </EventData>
</Event>

Connection string:

<add 
    name="DefaultConnection" 
    connectionString="Data Source=(localdb)\v11.0; Initial Catalog=WebMVCContext-20121205135209; Integrated Security=True; MultipleActiveResultSets=True; AttachDbFilename=|DataDirectory|WebMVCContext-20121205135209.mdf" 
    providerName="System.Data.SqlClient" />

Again, it is working and everything is connecting just get 10-20 of these for every connection.

回答1:

I have the same issue. It seems like a bug of Localdb. I have solved this issue by deleting the registry key:

HKEY_USERS\.DEFAULT\Software\Microsoft\Microsoft SQL Server\UserInstances\[GUID_FROM_EVENT_LOG]