This project is read-only.

Problem with VolatileAssembly directive in build-process integration

Jun 19, 2010 at 6:33 PM

Hi all, I'm having a problem using the VolatileAssembly directive and was wondering if anyone had an idea what the problem might be. When I save a template that has the VolatileAssembly directive in it, everything works great. However, I've also added build tasks to the project containing my template so that it gets built automatically when the project is built, as described in here.
  The problem occurs when I build the project containing the template, which gives me the following error:

A processor named 'T4Toolbox.VolatileAssemblyProcessor' could not be found for the directive named 'VolatileAssembly'. The transformation will not be run.

Any idea as to what could be the problem?

 

Thanks

Joni

Jun 19, 2010 at 9:11 PM

Joni,

MSBuild integration doesn't support registry-based directive processor registration. You have to define directive processors in your build project explicitly. More here: http://www.olegsych.com/2010/04/understanding-t4-msbuild-integration/

Oleg

Jun 21, 2010 at 9:07 PM

 Hi Oleg, thanks for the reply.

I added the following section in my project file:

<ItemGroup>
    <DirectiveProcessor Include="T4Toolbox.VolatileAssemblyProcessor" >
      <Class>T4Toolbox.VolatileAssemblyProcessor</Class>
      <Assembly>T4Toolbox.10.0, Version=10.3.7.1, Culture=neutral, PublicKeyToken=7e313accbcce84dc</Assembly>
    </DirectiveProcessor>
  </ItemGroup>

The assembly is in the GAC with the above signature. But this gives me the following error when building:

Running transformation: System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.VisualStudio.TextTemplating694984410C70E9E7E9F019C0140E4CBD.GeneratedTextTransformation.TransformText()
   at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result).

 

I also get a missing file showing up in my project called T4Toolbox.VolatileAssemblyProcessor.

 

Any suggestions?

Jun 25, 2010 at 12:18 PM

Have I misunderstood the post?

Jul 13, 2010 at 12:51 PM

Joni,

I have not tested the VolatileAssemblyProcessor with MSBuild functionality in the Visualization and Modeling SDK. You may be able to get more information here: http://www.georgemk.com/2009/12/t4-template-reference-to-frequently.html

Oleg