TDS: Deploy failed – “This software is protected to provide copy protection”

HedgehogHave you encountered a failure while executing an automated Sitecore deployment with TDS where the type initializer throws an exception and you are asked to reinstall the TDS application?  Apparently, if your TDS installation becomes corrupted somehow, you need to get rid of the web service and let TDS reinstall itself.  This might occur if you upgrade versions, at least, it did for me!  Here’s how to handle the issue…

The stack trace looks something like this:

C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets(381, 5): Deploy failed. Reason: Server was unable to process request. ---> The type initializer for 'HedgehogDevelopment.SitecoreProject.Service.TdsService' threw an exception. ---> The type initializer for '​​​​​​​​​​​' threw an exception. ---> This software is protected to provide copy protection and has been modified. Please re-install the application.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.Tasks.SitecoreConnector.TdsServiceSoap.Version(VersionRequest request)
at HedgehogDevelopment.SitecoreProject.Tasks.SitecoreConnector.TdsServiceSoapClient.Version()
at HedgehogDevelopment.SitecoreProject.Tasks.Z.3(String ​, TaskLoggingHelper ​)
at HedgehogDevelopment.SitecoreProject.Tasks.DeploySitecoreItems.Execute()
Project Sitecore.Cenovus\Dev\Iteration1\Build\Master\Master.scproj failed.

Hedgehog was very helpful and was able to provide me with steps to solve this.   The following steps will help you solve this issue:

  1. Navigate to your website root (e.g. \\myserver\my.site\Website\),
  2. Locate and remove the \_DEV folder
  3. Navigate to \bin
  4. Locate and remove the HedgehogDevelopment.SitecoreProject.Service.dll file
  5. Run your deployment on the problematic server again to see if it completes successfully

This fixed everything up for me.  Even though the files installed on the server looked like the right versions with the right content, the errors just wouldn’t go away until I let TDS reset itself with a fresh install.

Leave a 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 )

Facebook photo

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

Connecting to %s