T4 template was not generated. Controller and view file shows the “Errorgeneratingoutput” in VS2017 & VS 2019 combination machine RRS feed

  • Question

  • When create a project by choosing custom control like (grid control) to  asp.net mvc project. After creation of project, shows the "ErrorGeneratingOutput"in both controller and view file.

    We got a error like "There was a problem getting an appdomain to run the transformation from the host. The process cannot continue", while converting generating the t4 template file.  
     It shows only in Vs2017 and Vs2019 combination machine. Its working fine in vs2017 machine.

    Wednesday, March 20, 2019 9:27 AM

All replies

  • I am getting this as well with Vs2017 + Vs2019 when running T4 templates unrelated to MVC/ASP.NET ( class library)
    • Edited by Rodbourn Monday, October 28, 2019 6:53 PM
    Monday, October 28, 2019 6:52 PM
  • Can you post some additional details. Like how to replicate the problem?


    Ed Dore

    Tuesday, October 29, 2019 6:06 AM
  • Sure, just did the following to reproduce it (hoping it would solve it)

    Fresh Windows 10 LTS install, with all updates

    Install Visual Studio 2019 Ultimate

    Clone https://github.com/GuOrg/Gu.Units

    Build (which works well)

    Then try and run a text transforms. 

    Note if you just run the transforms, visual studio becomes unresponsive. 

    If you debug the templates that use the attribute 'hostspecific="true"', you get the exception without locking visual studio up. 

    Debugging the template, the host itself is not null, and has the expected properties.  It's very odd, and very frustrating. 

    Tuesday, October 29, 2019 2:26 PM
  • I downloaded and was able to build the project. Can you elaborate on what you meant by run the transforms?

    I did see a number of templates under the Gu.Units.Generator\Templates folder, and I can right click on them and select "Run Custom Tool" which seems to work, and doesn't lock up the IDE.

    I'm currently running VS Enterprise 16.3.7, with a modicum of extensions. Primarily the ones written by Mads, to facilitate VS Extension development. Have you tried running devenv.exe with /safemode to rule out any 3rd party extensions. (Just a wild guess)


    Ed Dore

    Thursday, October 31, 2019 10:21 PM