[MonoDevelop] TextTransform.exe not finding referenced assemblies
Tom Cook
tom.k.cook at gmail.com
Wed Dec 17 05:36:08 UTC 2014
I've looked into this myself. The error appears to be related to the
method
Mono.TextTemplating.TemplateGenerator.ResolveAssemblyReference(string)
which currently only has a stub implementation. I'd offer this diff as at
least an initial implementation:
diff --git
a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.
index 07b3197..cbe68af 100644
---
a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs
+++
b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplateGenerator.cs
@@ -198,9 +198,13 @@ namespace Mono.TextTemplating
//FIXME: implement
protected virtual string ResolveAssemblyReference (string
assemblyReference)
{
- //foreach (string referencePath in ReferencePaths) {
- //
- //}
+ if (System.IO.Path.IsPathRooted (assemblyReference))
+ return assemblyReference;
+ foreach (string referencePath in ReferencePaths) {
+ var path = System.IO.Path.Combine
(referencePath, assemblyReference);
+ if (System.IO.File.Exists (path))
+ return path;
+ }
return assemblyReference;
}
Regards,
Tom
On Tue, Dec 16, 2014 at 4:05 PM, Tom Cook <tom.k.cook at gmail.com> wrote:
>
> Is there no-one on this list who knows about TextTransform.exe?
>
> Thanks,
> Tom
>
> On Wed, Dec 3, 2014 at 12:18 PM, Tom Cook <tom.k.cook at gmail.com> wrote:
>>
>> Sorry if this is the wrong forum for this.
>>
>> I'm trying to port some T4 templates from Windows to Mono on Linux.
>> They include <#@ assembly #> references to an assembly which provides
>> some custom functions written in C# which are used in the templates.
>> Within the templates, these are given as:
>>
>> <#@ assembly name="DataModelDefinition.dll" #>
>>
>> The assembly builds fine in Monodevelop using the pre-existing Visual
>> Studio 2013 solution, but no matter what I try, I can't make
>> TextTransform find this assembly. So far I've tried adding an
>> explicit reference to the assembly on the command line:
>>
>> TextTransform.exe
>> -r=$(pwd)Output/x86/Release/DataModelDefinition.dll ...
>> ProcessFiles.tt
>>
>> and telling TextTransform where to search for it:
>>
>> TextTransform.exe -P=$(pwd)Output/x86/Release ... ProcessFiles.tt
>>
>> and setting MONO_PATH to find it:
>>
>> export MONO_PATH=$(pwd)Output/x86/Release
>> TextTransform.exe ... ProcessFiles.tt
>>
>> as well as various combinations of the above, but no matter what I try
>> the answer is always the same:
>>
>> Processing 'ProcessFiles.tt'... failed.
>> (0,0): ERROR Metadata file `GH.DataModelDefinition.dll' could not be
>> found
>>
>> Is there some way to get TextTransform to find this file?
>>
>> Thanks,
>> Tom
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodevelop-list/attachments/20141217/96c7e43d/attachment.html>
More information about the Monodevelop-list
mailing list