8

Our admin set up a brand new Windows 2012 R2 server with Visual Studio 2015. When I try to connect to an existing sql server 2008 database (running on a windows 2008 r2 server) from Visual Studio, using Tools -> Connect to database..., I can enter all the information, the dialog retrieves the list of databases, Test Connection works, but when I click ok I get:

The computer must be trusted for delegation and the current user account must be configured to allow delegation

Both servers are under the same domain (development) and I am local admin on both of them. My account though is on a different domain that has access to the development domain.

Any ideas on how to fix this? Are they referring to the windows 2012 server or the database server in the message?

Just as a side note, I can connect successfully from another windows 2008 r2 server using the same windows account.

Update: the connection that fails uses windows authentication.

7
  • If you are using Windows authentication, this is possibly an issue with SPN and Kerberos. If you're using SQL authentication, then I'm at a loss. Commented Jul 7, 2017 at 23:50
  • Yes, I am using windows authentication. SQL authentication works fine.
    – boggy
    Commented Jul 8, 2017 at 0:18
  • Give this a look. Definitely Kerberos issue, which means you need to either run SetSPN, or modify the AD to give SPN permissions to the account that's running the SQL service. technet.microsoft.com/en-us/library/bb735885.aspx Commented Jul 8, 2017 at 0:20
  • @RandolphWest: are you saying that VS 2015 running on Windows 2012 R2 uses Kerberos when I use windows authentication to connect to sql server 2008 (running on windows 2008 R2) instead of NTLM?
    – boggy
    Commented Jul 10, 2017 at 22:09
  • @RandolphWest: What's weird is that I can see the databases, Test Connection is successful but then when I click ok it fails with the message above.
    – boggy
    Commented Jul 10, 2017 at 22:10

1 Answer 1

9

According to KB3000850, this affects domain-joined Windows 8.1 computers after installing security update 2992611 or update 3000850.

I added the following value under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Protect\Providers\df9d8cd0-1501-11d1-8c7a-00c04fc297eb

ProtectionPolicy = 1 (DWORD)

Now I can connect.

I found some other postings about this:

https://blog.sqlauthority.com/2017/04/01/sql-server-system-security-cryptography-cryptographicexception-error-generating-xml-document/

https://social.technet.microsoft.com/Forums/windows/en-US/47faab6b-d717-4068-bee4-c694811e0066/credential-manager-problems-error-0x80090345?forum=w8itpronetworking

5
  • It appears to have something to do with Read-Only Domain Controllers, according to Pinal's post. Fascinating. Thanks for this find. Commented Jul 14, 2017 at 17:57
  • I also had this problem using a Synology DS1813+ as a domain controller, and adding this registry key to my PC fixed it. Thanks! Commented May 9, 2018 at 3:33
  • This can also be a Windows 10 issue. Adding this registry key fixed it, though!
    – Kelly
    Commented Aug 3, 2018 at 15:09
  • This also fixes the error: "error : Problem getting session token from the server. 'Microsoft.Identity Service.Clients.ActiveDirectory.AdalSilentTokenAcquisitionException: Failed to acquire token silently as no token was found in the cache. Call method AcquireToken" when trying to login to Visual Studio 2017 professional on a domain joined computer. thank you very much.
    – Mudo
    Commented Dec 28, 2019 at 4:01
  • while this does fix various issues, I'm not convinced that it's the correct solution. supposedly this causes the master key to be backup locally rather than on the server, which can cause issues. the better solution should be to get the master key to backup on the domain controller, but I don't know what causes it not to be able to. information about this issue can be found here: learn.microsoft.com/en-us/troubleshoot/windows-server/identity/… Commented Apr 22, 2022 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.