Welcome Guest! To enable all features please Login or Register.



#1 Posted : Thursday, September 26, 2019 8:42:51 AM(UTC)
Rank: Newbie

Groups: Member
Joined: 9/26/2019(UTC)
Posts: 1
Location: Perth

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 issue

However 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>
// 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");

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.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF | YAF © 2003-2022, Yet Another Forum.NET
This page was generated in 0.106 seconds.

Authorization on the site

For an authorized user opens up new possibilities