question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SqlClient: Allow |DataDirectory| macro in AttachDBFilename

See original GitHub issue

Now that .NET Standard 2.0 includes AppDomain.GetData, there shouldn’t be anything blocking the implementation to expand the |DataDirectory| substitution string in the AttachDBFilename value of the connection string.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bricelamcommented, Nov 21, 2019

Yeah, but we already have the code to handle |DataDirectory| during CREATE DATABASE in EF Core 3.0.0, so if you just update SqlClient it should all work.

1reaction
cheenamalhotracommented, Nov 20, 2019

Closing as #284 has been merged and fix will be available in v1.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql - Can't connect to localdb when using [DataDirectory] in ...
finally found my solution , i was using System.Data.SqlClient which doesn't support |DataDirectory| in: AttachDbFilename= . the new ...
Read more >
SqlConnectionStringBuilder.AttachDBFilename Property
Gets or sets a string that contains the name of the primary data file. This includes the full path name of an attachable...
Read more >
Wrox's SQL Server 2005 Express Edition Starter Kit
There are two main mechanisms that enable Xcopy support in SSE: automating ... macro called |DataDirectory| that is commonly used with AttachDBFilename.
Read more >
Using dotConnect Universal with SQL Client
If DataDirectory is used, the database file must exist within a subdirectory of the directory pointed to by the substitution string. The database...
Read more >
Visual Studio and local databases - The grokking eagle
This allows Visual Studio to put a special variable in the connection string that ... SQLExpress;AttachDbFileName=|DataDirectory|\data.mdf”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found