I'm currently working on a C# solution that was abandonned years ago by somone i have no contact with. It uses a Wix to generate the msi and contain a whole project named "TemplatingWixSetup" that include T4 templates. Note that i'm note experienced with Wix setting. Part of them contains methods but those were not included in any class definition. This was not compiling so i included all the methodes in a class named after the .tt file name for each templates. Here the WixDirectoryTree.tt contains the methods needed so i included all the methods it contained in the class named WixDirectoryTree.
I then get few errors for one of the templates. It only uses one of the methods to check the existance of a directory and create it if needed.
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".wxs" #>
<#@ assembly name="System.Core.dll" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Security.Cryptography" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ include file="WixDirectoryTree.tt" #>
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<#
TryAndGenerateDirectory(@"..\MatterSlice", "OpenSourceMatterSlice", "$(var.SolutionDir)MatterSlice", "ProgramFilesOpenSourceMatterSlice");
TryAndGenerateDirectory(@"..\t4", "OpenSourceMonoT4", "$(var.SolutionDir)t4", "ProgramFilesOpenSourcet4");
#>
</Wix>
I maneged to correct part of them by creating a instance of the class i included in WixDirectoryTree but one error remains. See the folowing code which is the whole concerned file:
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".wxs" #>
<#@ assembly name="System.Core.dll" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Security.Cryptography" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ include file="WixDirectoryTree.tt" #>
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<# var wixDirectoryTree = new WixDirectoryTree();
wixDirectoryTree.TryAndGenerateDirectory(@"..\MatterSlice", "OpenSourceMatterSlice", "$(var.SolutionDir)MatterSlice", "ProgramFilesOpenSourceMatterSlice");
wixDirectoryTree.TryAndGenerateDirectory(@"..\t4", "OpenSourceMonoT4", "$(var.SolutionDir)t4", "ProgramFilesOpenSourcet4");
#></Wix>
There is the error:
Erreur CS1022 Compiling transformation: Type or namespace definition, or end-of-file expected TemplatingWixSetup C:\Users\Admin\Documents\cola\TemplatingWixSetup\OpenSource.tt 350 Actif
I honestly don't know what to do, or what could cause the problem. I made sure that the tag '' is not followed by anything. I wonder if it has anything to do with the fact that i introduced the class befor but that also implies compliling errors.