Hi,
I am getting an error when trying to retrieve the classes within an object in an referenced dll.
The Error is;
Compiling transformation: 'GeneratedTextTransformation.AutomationHelper' does not contain a definition for 'GetAllCodeElementsOfType' and no accessible extension method 'GetAllCodeElementsOfType' accepting a first argument of type 'GeneratedTextTransformation.AutomationHelper' could be found (are you missing a using directive or an assembly reference?) OurWorld.T4 C:\Users\pd52203\Git\OurWorld\OurWorld\OurWorld.T4\T4Test\Template1.tt 36
This looks very similar to the 6 year old error reported in
this issueHowever the issue suggests it was bug fixed some time ago, but trial version download was very recent.
The Helper retrieves the project just fine, but it does recognise the "GetAllCodeElementsOfType" method.
<#
//template code - you get IntelliSense here
string Greeting = "Hello";
string SampleInputFileContent
= @"<Model>
<Table name=""Rain""><Column name=""Night""/><Column name=""Day""/></Table>
<Table name=""Temperatur""><Column name=""Night""/><Column name=""Day""/></Table>
</Model>";
// Certainly you would normally load the model data from a file using
// the relative path of the template as shown below:
// string SampleInputFileContent = System.IO.File.ReadAllText(
// System.IO.Path.GetDirectoryName(this.Host.TemplateFile) + "\\datafile.xml");
var project = VisualStudioHelper.GetProject("OurWorld.Data");
// ERROR ON THE NEXT LINE
var allClasses = VisualStudioHelper.GetAllCodeElementsOfType(project.CodeModel.CodeElements, EnvDTE.vsCMElement.vsCMElementClass, false);
#>
Rod attached the following image(s):

T4Error.PNG
(73kb) downloaded 2 time(s).You cannot view/download attachments. Try to login or register.