Failed to generate source from template

Feb 13, 2010 at 1:38 PM

Hello,

[VS 2010 RS]

after creating a new UnitTest template i got errors in source generation from template step:

Error    1    Errors were generated when initializing the transformation object. The transformation will not be run.  The following Exception was thrown:
System.TypeLoadException: Could not load type 'Microsoft.VisualStudio.TextTemplating.Interfaces.ITextTemplatingEngineHost' from assembly 'Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at T4Toolbox.TestRunner.RunTests()
   at Microsoft.VisualStudio.TextTemplatingF915D88CB81C8C0D5E8A5C5BC42C8959.GeneratedTextTransformation.Initialize() in c:\TestForTest\UnitTest2.tt:line 28
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)        1    1 

Error    2    An Exception was thrown while running the transformation code. The process cannot continue.  The following Exception was thrown:
System.TypeLoadException: Could not load type 'Microsoft.VisualStudio.TextTemplating.Interfaces.ITextTemplatingEngineHost' from assembly 'Microsoft.VisualStudio.TextTemplating.Interfaces.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
   at T4Toolbox.TransformationContext.OnTransformationEnded(TextTransformation transformation)
   at Microsoft.VisualStudio.TextTemplatingF915D88CB81C8C0D5E8A5C5BC42C8959.GeneratedTextTransformation.Dispose(Boolean disposing) in c:\TestForTest\UnitTest2.tt:line 18
   at Microsoft.VisualStudio.TextTemplating.TextTransformation.Dispose()
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)        1    1 

Template is default:

<#@ template language="C#" hostspecific="True" debug="True" #>
<#@ output extension="log" #>
<#@ include file="T4Toolbox.tt" #>
<#@ include file="T4Toolbox\UnitTesting.tt" #>
<#@ import namespace="System.Diagnostics" #>
<#+
// <copyright file="UnitTest2.tt" company="none">
//  Copyright © none. All Rights Reserved.
// </copyright>

[TestClass]
public class UnitTest2
{
    [TestInitialize]
    public void TestInitialize()
    {

    }

    [TestCleanup]
    public void TestCleanup()
    {

    }

    [TestMethod]
    public void Test_Success()
    {
        Assert.Inconclusive();
    }

    [TestMethod]
    [ExpectedException(typeof(Exception))]
    public void Test_Exception()
    {
        Assert.Inconclusive();
    }
}
#>

Any ideas what is worng?

Thank you.

Coordinator
Feb 13, 2010 at 5:01 PM

December build doesn't support 2010 RC: http://t4toolbox.codeplex.com/WorkItem/View.aspx?WorkItemId=16306