title: TT Transformation fails on loading EnvDTE._Solution
body: <p>We are using T4 templates in our project to generate C# code. The templates inspect the current solution and projects using DTE like this: </p>
  
  <pre><code>DTE dte = (DTE)((IServiceProvider)Host).GetService(typeof(DTE)); 
  Solution solution = dte.Solution; 
  Project project = solution.Project("...");
  </code></pre>
  
  <p>Recently the engine started to fail with the error below. There was no change in the template or relevant code, so I believe this is to do with some visual studio / .NET update. But I have no idea how to fix this. </p>
  
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error       Running transformation: System.Runtime.Remoting.RemotingException: Cannot load type 'EnvDTE._Solution, CodeGenerationUtils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  
  Server stack trace: 
     at System.Runtime.Remoting.Messaging.MethodCall.ResolveMethod(Boolean bThrowIfNotResolved)
     at System.Runtime.Remoting.Messaging.MethodCall..ctor(SmuggledMethodCallMessage smuggledMsg, ArrayList deserializedArgs)
     at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage&amp; smuggledMrm)
     at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
  
  Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
     at EnvDTE._Solution.get_Projects()
     at XXXXX.CodeNavigator.Projects(Solution solution) in C:\XXXXX\CodeNavigator.cs:line 29
     at XXXXX.CodeNavigator.Project(Solution solution, String name) in C:\XXXXX\CodeNavigator.cs:line 24
     at Microsoft.VisualStudio.TextTemplating7C92645F4B28BF7FDF611D165F2230AA45B6BB3184F9527C2F8B592506527D4AC5FBE363A1B068750F0082F78E0BBE35E12B9F21E89803E59119D9A2834641A7.GeneratedTextTransformation.TransformText() 
  </code></pre>