Transforming T4 template on build intermittently produces an exception

  • Thread starter Thread starter binginsin
  • Start date Start date
B

binginsin

Guest
Hi all,

I'm using

<PropertyGroup>
<TransformOnBuild>True</TransformOnBuild>
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
</PropertyGroup>

to transform all templates in the project upon building. This works most of the time, however, sometimes it throws this:

error : An Exception was thrown while processing a directive named 'Dsl'. The transformation will not be run. The following Exception was thrown: [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Modeling.Sdk.15.0, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : File name: 'Microsoft.VisualStudio.Modeling.Sdk.15.0, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : at Microsoft.VisualStudio.Modeling.DslDefinition.DslDirectiveProcessorBase.GeneratePostInitializationCode(String directiveName, StringBuilder codeBuffer, CodeDomProvider languageProvider, IDictionary`2 requiresArguments, IDictionary`2 providesArguments) [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : at Microsoft.VisualStudio.Modeling.DslDefinition.DslDirectiveProcessor.GeneratePostInitializationCode(String directiveName, StringBuilder codeBuffer, CodeDomProvider languageProvider, IDictionary`2 requiresArguments, IDictionary`2 providesArguments) [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : at Microsoft.VisualStudio.TextTemplating.RequiresProvidesDirectiveProcessor.ProcessDirective(String directiveName, IDictionary`2 arguments) [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, ITelemetryScope scope, IEnumerable`1 directivesToBeProcessed) [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : WRN: Assembly binding logging is turned OFF. [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : Note: There is some performance penalty associated with assembly bind failure logging. [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]
error : . Line=4, Column=4 [C:\Source\Trunk\Projects\Driver.Design.Package\Driver.Design.Package.csproj]


I rebuilt this project 1000 times overnight, and it threw this exception twice. It normally wouldn't be a problem, but this project will be part of a TFS build pipeline, and I wouldn't want this to cause any failures.

Considering it builds 99% of the time, I'm pretty lost on what could be the cause of this.

Continue reading...
 
Back
Top