Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:52:53+00:00 2026-06-18T06:52:53+00:00

I’m getting the exception The underlying provider failed on ConnectionString. with inner exception Invalid

  • 0

I’m getting the exception

The underlying provider failed on ConnectionString.

with inner exception

Invalid value for key ‘attachdbfilename’

on a windows 7 home premium virtual machine as i’m trying to deploy and debug my application.

However, on my development machine, the application just launches without problems.

the connection string is :

<add name="AssetsLocalDBEntities" connectionString="metadata=res://*/AssetsLocalDB.csdl|res://*/AssetsLocalDB.ssdl|res://*/AssetsLocalDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(localdb)\v11.0;attachdbfilename=|DataDirectory|\AssetDatabase.mdf;initial catalog=AssetDBSource;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

Steve Wellens has mentioned that the connection string contains garbage in this topic:
The underlying provider failed on ConnectionString

yet, as Maxim Gueivandov has replied, this should valid connection string, as it’s directly generated by the EntityFramework’s edmx designer.
At least, i believe it to be valid, as it does work on the development machine.

Also in another topic (Entity Framework – The underlying provider failed on ConnectionString), the accepted answer is to remove the &quot; and replace them by \", as the string is a literal in the c# code, yet i still have my connection string in xml, so &quot; cannot simply be replaced.
on-connectionstring

The .NET version installed on the virtual machine is 4.0.30319 and MsSQL Server Express LocalDB is 11.0.2318.0, so i believe they are both up to date.

Edit: If i remove “|DataDirectory|” from the connection string i get the following error on my development machine:

Cannot attach the file ‘AssetDatabase.mdf’ as database ‘AssetDBSource’.

So i also remove “initial catalog=AssetDBSource” and i get

An attempt to attach an auto-named database for file AssetDatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

i can emagine this is because it doesn’t know where to look? so, i provide it the full path (C:..\AssetDatabase.mdf) and it works.

So the remainder of the question is: how do i get relative paths working with LocalDB?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:52:54+00:00Added an answer on June 18, 2026 at 6:52 am

    I believe the target machine doesn’t have the Update 4.0.2 or later for .NET 4 installed. The .NET 4 version number can be confusing, as version 4.0.30319 seems to be used by all .NET 4 builds. In effect it does not mean your machine has the Update 4.0.2.

    Can you install .NET 4 Update 4.0.3 (latest .NET 4 update as of today) on the target machine and see if the problem goes away?

    Or just verify that the update is installed – just build a simple application in .NET 4 that uses SqlClient to connect to LocalDB using the connection string, and record the error information in case you still hit any errors. The EF error message is fairly generic, and I don’t know how to get a detailed error from the underlying SqlClient provider.

    Alternatively you could also migrate it to .NET 4.5.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am confused How to use looping for Json response Array in another Array.
I am using JSon response to parse title,date content and thumbnail images and place

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.