4

I am trying to generate code from TDS code Generation by following GlassTutorial24 TDS version: 5.1.0.3, visual studio 2012.

The generated class only has "ErrorGeneratingOutput".

My project properties as below: TDS Project Properties

Edit 1:

Error while building:

Error 1 Compiling transformation: Metadata file 'HedgehogDevelopment.CodeGeneration.Extensions.dll' could not be found xxx.TDS.Master\Code Generation Templates\glassv3header.tt

Error 2 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration xxx.TDS.Master\Code Generation Templates\GlassV3Item.tt

Error 3 Compiling transformation: Method must have a return type xxx.TDS.Master\Code Generation Templates\GlassV3Item.tt

Error 4 Compiling transformation: Type expected xxx.TDS.Master\Code Generation Templates\GlassV3Item.tt

Dheeraj Palagiri
  • 1,829
  • 3
  • 23
  • 46
  • Hi Dheeraj, can you get more details on the error from your target file? – Elena Mosoff Mar 17 '15 at 15:52
  • My target file only have "ErrorGeneratingOutput" 2274 times – Dheeraj Palagiri Mar 17 '15 at 15:53
  • how about your output window from 'Team Development for Sitecore' – Elena Mosoff Mar 17 '15 at 15:58
  • Make sure that the tt templates don't have any new lines or white spaces at the end of the files. – Ehab ElGindy Mar 17 '15 at 16:06
  • Some tips here: https://jammykam.wordpress.com/2015/02/06/upgrade-sitecore-glass-mapper-from-v2-to-v3/ Unblock the .tt files and make sure you remove the new lines in at the end of the .tt files – jammykam Mar 17 '15 at 16:50
  • possible duplicate of [Glass Mapper t4 null or empty string](http://stackoverflow.com/questions/28306152/glass-mapper-t4-null-or-empty-string) – jammykam Mar 17 '15 at 16:51
  • Actually no, i have unblocked .tt file and removed all new lines at the end of files. still no code is generated. – Dheeraj Palagiri Mar 17 '15 at 17:25
  • Well your original question was a dupe. If you have new or different errors please provide a stack trace. If the output window shows very little then change the build output verbosity in Visual Studio (Tools > Options > Projects > Build and Run) http://imgur.com/3oQ3rdk – jammykam Mar 17 '15 at 17:31

3 Answers3

5

Unfortunately the tutorial was out of date and need to be updated to the new code generation templates.

You need to use the files from Hedgehogs Repository: https://github.com/HedgehogDevelopment/tds-codegen/tree/master/Sitecore.Master/Code%20Generation%20Templates

You also need the following files:

  • Helpers.tt
  • GlassV3Header.tt
  • GlassV3Item.tt
  • GeneralExtensions.tt
  • Inflector.tt
  • StringExtensions.tt

The tutorial has now been updated as well:

http://www.glass.lu/Mapper/Sc/Tutorials/Tutorial24.aspx

Michael Edwards
  • 6,308
  • 6
  • 44
  • 75
  • Compiling transformation: Metadata file 'HedgehogDevelopment.CodeGeneration.Extensions.dll' could not be found xxx.TDS.Master\Code Generation Templates\glassv3header.tt – Dheeraj Palagiri Mar 18 '15 at 14:55
  • Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration xxx.TDS.Master\Code Generation Templates\GlassV3Item.tt – Dheeraj Palagiri Mar 18 '15 at 14:56
  • Compiling transformation: Method must have a return type xxx.TDS.Master\Code Generation Templates\GlassV3Item.tt 1 – Dheeraj Palagiri Mar 18 '15 at 14:57
  • @DheerajPalagiri: Check GlassV3Header.tt and GlassV3Item.tt and remove any empty lines at the end of the files. – jammykam Mar 18 '15 at 23:58
  • @jammykam I am sure i removed white spaces and empty lines on all the templates.. – Dheeraj Palagiri Mar 19 '15 at 10:16
  • Did you update all the tt's? The latest GlassV3Header.tt file does not contain a reference to HedgehogDevelopment.CodeGeneration.Extensions.dll – Michael Edwards Mar 20 '15 at 11:38
2

If you are getting HedgehogDevelopment.CodeGeneration.Extensions.dll error in TDS Sitecore project then put HedgehogDevelopment.CodeGeneration.Extensions.dll into C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies folder for Visual Studio 2012.

This fixed the issue for me.

DdW
  • 890
  • 1
  • 18
  • 30
kiran
  • 53
  • 4
1

We just encountered this issue.

There was an empty line at the end of the GlassV3Item.tt file.

Removing that empty line caused the code to be generated successfully.

Ryan Tuck
  • 121
  • 1
  • 3