问题
After installing Visual Studio 2012 Ultimate on Windows 8, SSDT via SQL Server Object Explorer did not work. The solution was to install the latest version of VS2012 from the MSDN website.
All was well. I could see databases, no problem. It did not matter whether I used the EF defaultConnectionFactory or my own connectionString, either way, all of my code first databases showed up in the VS2012 SQL Server Object Explorer.
Not long ago, I installed Visual Studio 2013 Ultimate. In VS2013 Ultimate, local db, all I see, via properties, is this connection string:
Data Source=(localdb)\Projects;
Initial Catalog=master;Integrated Security=True;
Connect Timeout=30;Encrypt=False;TrustServerCertificate=False
Next, when I tried to look via VS2012, VS2012 was again broken. To get VS2012 to work again, I installed the 2013 October version of SSDT for VS2012 from MSDN.
While VS2012 SSDT now worked again via SQL Server Object Explorer, unfortunately, the behaviour was identical to that of SSDT in VS2103.
I am able to connect via LINQPad4 which does have some advantages because of the useful LINQ choices that one gets simply by right-clicking on a table name.
Using EF 6.0.1 code first.
回答1:
The clue is Data Source=(localdb)\Projects;
EF 6.0.1 puts the databases here: Data Source=(localdb)\v11.0;
Data Source=(localdb)\v11.0;
Integrated Security=True;Connect Timeout=15;
Encrypt=False;TrustServerCertificate=False
in SSDT in vs2012/vs2013 [View, SQL Server Object Explorer],
right-click the node "SQL Server", then click "Add SQL Server..."
Type "(localdb)\v11.0" for the server name and click Connect.
You should now see both "(localdb)\v11.0" and "(localdb)\Projects" in SQL Server Object Explorer.
Your code first databases will be in the Databases node under "(localdb)\v11.0".
FWIW, i have zero idea why Microsoft made this annoying change.
来源:https://stackoverflow.com/questions/20200162/ssdt-on-visual-studio-2012-broken-then-fixed-broken-again-also-broken-on-vs2013