locked
TextTransform.exe using git push to deploy RRS feed

  • Question

  • I wrote a pre build event that uses TextTransform.exe to generate some classes.

    Works great at localhost but, is there any aproach to use TextTemplating.exe at build event time when azure compiles my site ?



    • Edited by Jordi Vila Thursday, July 3, 2014 12:36 PM
    Thursday, July 3, 2014 12:35 PM

Answers

  • Sorry for the late reply. I think the problem is that TextTransform.exe basically only works when you have VS installed. There is an old Connect about it that doesn't seem to go anywhere.

    So it may not be that easy to get things working on the Azure Web Sites build machine.

    Wednesday, August 6, 2014 6:21 PM

All replies

  • Azure just uses regular msbuild, so if it works locally when you "deploy to file system", it should work there as well. Check out this page for some info on isolating this type of issues.

    David

    Thursday, July 3, 2014 3:52 PM
  • Thank you David for your help

    The site can be deployed locally and pushing it to azure as well. But, that pre-build event is using Texttransform utility to create some files before compiling the application.

    The site can be published because those *.tt files do not throw exceptions, but I can read on the deployment logs the warnings my build event generates because texttransform.exe is not found.

    I know it might be not possible to use this tool while building the application with Kudu, but i would like to know if there is any approach to accomplish it.


     


    Thursday, July 3, 2014 5:12 PM
  • So it sounds like the issue is that this file is missing on the Azure machine where sites get built? If you have a minimal sample repo that demonstrates the issue (e.g. shared on GitHub), we can look into adding support for this later (if feasible. we need to investigate).
    Thursday, July 3, 2014 5:19 PM
  • Yes, the issue is TextTransform.exe is not found. It is usually found at \Program Files\Common Files\Microsoft Shared\TextTemplating\x.x  and I think is installed with SDK.

    https://github.com/jordivila/BuildEventTextTransformSample.git

    • Edited by Jordi Vila Thursday, July 3, 2014 8:29 PM
    Thursday, July 3, 2014 8:28 PM
  • I tried deploying this repo to Azure, and I did not get a deployment error. Could you clarify:

    • the behavior that you expect to see if there was no issue
    • the behavior that you observe instead

    Thanks!

    Thursday, July 3, 2014 8:39 PM
  • The behavior that you observe instead

    If you could take a look at the log generated by the azure deployment you should see something like 

    The system cannot find the path specified.
      ERROR OCCURRED WHILE GENERATING "Template.Resources.Helpers.ResourceMvcHelper"
      REMEMBER TO CHECKOUT FILE "Template.Resources.Helpers.ResourceMvcHelper.cs"

    This is the result of executing the batch file when pre-build event is fired. This batch file path is  "BuildEventTextTransformSample / T4Templates / ResourceBuildEventPre.cmd"

    If you could take a look at the cmd batch file you should see 

    set ttFilePath=%1
    set targetName=%2
    set ttExeFile="%CommonProgramFiles%\microsoft shared\TextTemplating\12.0\TextTransform.exe"

    %ttExeFile% %ttFilePath% -a !!targetName!%targetName% 

    IF ERRORLEVEL  1 GOTO Label1
    GOTO End

    :Label1
    echo ERROR OCCURRED WHILE GENERATING "Template.Resources.Helpers.ResourceMvcHelper"
    echo REMEMBER TO CHECKOUT FILE "Template.Resources.Helpers.ResourceMvcHelper.cs"

    The expected behavior is an azure log after building the repo with no errors.

    Thursday, July 3, 2014 9:08 PM
  • When I git push it to Azure Web Sites, it does not even treat it as an ASP.NET project because it doesn't have ProjectTypeGuids.

    Here is exactly what I'm trying:

    • Clone your repo
    • Create new site with local git
    • Git push to it

    If you try those exact steps, do you get the error above? If your steps are different, please list them exactly.

    Thursday, July 3, 2014 11:05 PM
  • David,

    I just published the whole web application to https://github.com/jordivila/Net_MVC_NLayer_Result.git

    1.- Integrate an azure web site with this repo and the deployment command begins

    2.- Everything works just fine and the deployment status changes to  ACTIVE DEPLOYMENT. But, when a "View Log" the deployment I find :

    The system cannot find the path specified.
      ERROR OCCURRED WHILE GENERATING "Template.Resources.Helpers.ResourceMvcHelper"

    REMEMBER TO CHECKOUT FILE "Template.Resources.Helpers.ResourceMvcHelper.cs"



    This warning is thrown by the build event located at "VsixMvcAppResult.Resources\T4Templates\ResourceBuildEventPre.cmd" which tries to execute "%CommonProgramFiles%\microsoft shared\TextTemplating\12.0\TextTransform.exe"

    Should I try using the Microsoft.TextTemplating.targets which come with the Visual Studio Visualization and Modeling SDK ?

    Friday, July 4, 2014 10:02 AM
  • Sorry for the late reply. I think the problem is that TextTransform.exe basically only works when you have VS installed. There is an old Connect about it that doesn't seem to go anywhere.

    So it may not be that easy to get things working on the Azure Web Sites build machine.

    Wednesday, August 6, 2014 6:21 PM