TDS Error: Test connection to Sitecore

This morning, while setting up a new solution, I started getting an error on the last step of the TDS Build Settings Test dialog – Test connection to Sitecore:

tds-test-connection-to-sitecore-error

And here’s the error trace I was getting in the Visual Studio output window:

Connection Test Failure: Failed to complete test.
Exception System.Web.Services.Protocols.SoapException: Access to the path 'C:\inetpub\wwwroot\sc902.local\App_Data\serialization\master' is denied. ---> System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\sc902.local\App_Data\serialization\master' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at Sitecore.Data.Serialization.DefaultSerializationManager.DumpItem(String path, Item item)
at HedgehogDevelopment.SitecoreProject.Service.TdsService.<>c__DisplayClass2.b__0()
at HedgehogDevelopment.SitecoreProject.Service.TDSExecutionContext.Wrap[T](Func`1 func)
at HedgehogDevelopment.SitecoreProject.Service.TdsService.GetItem(String key, String sitecoreDatabase, String accessGuid, String itemIdOrPath)
--- End of inner exception stack trace ---
at HedgehogDevelopment.SitecoreProject.Service.TdsService.GetItem(String key, String sitecoreDatabase, String accessGuid, String itemIdOrPath) (FaultException):

Server stack trace: 
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoap.GetItem(GetItemRequest request)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoapClient.HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoap.GetItem(GetItemRequest request)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoapClient.GetItem(String key, String sitecoreDatabase, String accessGuid, String itemIdOrPath)
at HedgehogDevelopment.SitecoreProject.VSIP.ProjectTests.ConnectionTest.<>c__DisplayClass3_0.b__0(String key)
at HedgehogDevelopment.SitecoreProject.VSIP.Utils.Support.CallServiceWrapper[T](TdsServiceSoapClient client, SitecoreProjectNode project, Func`2 clientCall)
at HedgehogDevelopment.SitecoreProject.VSIP.ProjectTests.ConnectionTest.Execute()
at HedgehogDevelopment.SitecoreProject.VSIP.Dialogs.BuildTestDialog.RunTests()
Connection Test Finish: 2018-11-10 10:48:02

On Google, I found this discussion on the Sitecore Community – https://community.sitecore.net/developers/f/5/p/3696/11162.  I also found this blog post by Jason St-Cyr – https://theagilecoder.wordpress.com/2013/03/02/tds-so-youre-deploying-sitecore-to-a-new-environment/.  The proposed solution in both was the same – delete the serialization folder and let TDS create it again.  The problem is, in my case, I didn’t even have a serialization folder to begin with so this solution wouldn’t solve my problem.

Since I didn’t have the folder at all, I tried manually creating the \serialization\master folders.  This got me past the first error, but then I started getting a second error:

Connection Test Failure: Failed to complete test.
Exception System.Web.Services.Protocols.SoapException: Access to the path 'C:\inetpub\wwwroot\sc902.local\App_Data\serialization\master\sitecore.item' is denied. ---> System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\sc902.local\App_Data\serialization\master\sitecore.item' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at Sitecore.Data.Serialization.DefaultSerializationManager.DumpItem(String path, Item item)
at HedgehogDevelopment.SitecoreProject.Service.TdsService.<>c__DisplayClass2.<GetItem>b__0()
at HedgehogDevelopment.SitecoreProject.Service.TDSExecutionContext.Wrap[T](Func`1 func)
at HedgehogDevelopment.SitecoreProject.Service.TdsService.GetItem(String key, String sitecoreDatabase, String accessGuid, String itemIdOrPath)
--- End of inner exception stack trace ---
at HedgehogDevelopment.SitecoreProject.Service.TdsService.GetItem(String key, String sitecoreDatabase, String accessGuid, String itemIdOrPath) (FaultException):

Server stack trace: 
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoap.GetItem(GetItemRequest request)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoapClient.HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoap.GetItem(GetItemRequest request)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreConnector.TdsServiceSoapClient.GetItem(String key, String sitecoreDatabase, String accessGuid, String itemIdOrPath)
at HedgehogDevelopment.SitecoreProject.VSIP.ProjectTests.ConnectionTest.<>c__DisplayClass3_0.<Execute>b__0(String key)
at HedgehogDevelopment.SitecoreProject.VSIP.Utils.Support.CallServiceWrapper[T](TdsServiceSoapClient client, SitecoreProjectNode project, Func`2 clientCall)
at HedgehogDevelopment.SitecoreProject.VSIP.ProjectTests.ConnectionTest.Execute()
at HedgehogDevelopment.SitecoreProject.VSIP.Dialogs.BuildTestDialog.RunTests()
Connection Test Finish: 2018-11-10 10:54:30

It was pretty clear I was going to keep getting these errors.

And yes, I was running Visual Studio as Administrator.

So, the ultimate solution for me, was adjusting permissions on my Sitecore website folder.  I ended up giving Everyone full control of the folder.

giving-everyone-full-control-of-sc902.local

After making this change, I went back to Visual Studio and ran the TDS Build Settings Test again and it worked!

tds-test-connection-to-sitecore-success

I’m not loving the fact that I had to give Everyone full control of the folder but, given that this is my local machine, I’m not too worried about.

And, in case you’re wondering, here are the versions of the applications in question:

  • Windows 10 Enterprise, version 1803, OS build 17134.345
  • Sitecore 9.0.2 XP0
  • Visual Studio 2017 version 15.8.7
  • TDS 5.7.0.16

3 thoughts on “TDS Error: Test connection to Sitecore

  1. I remember having to work through a similar error because I was running sitecore on a mapped directory that existed on my mac host and IIS was serving it via a Parrallels VM. I will never try that setup again! when in doubt, check permissions!!

    Liked by 1 person

  2. I had exactly the same issue. I’m glad that I found your post, but I didn’t want to believe that I had to give full control to Everyone.
    So after a little bit of experimenting I found that it was enough to give full control only to IIS user (IIS_IUSRS). Sounds a bit better.

    Like

Leave a Reply to dcasey23 Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s