Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
T4 can't found include file, but visual studio 2010 did.
F:\UMPWebSolution\UMPWeb.Model\GsmsTyped.tt(5,5): Error: Could not resolve include file '$(ProjectDir)..\UMPWeb.Logic.Mysql\DatabaseHelper.tt'. (UMPWebSolution)
The $(ProjectDir) substitution isn't actually a feature of the T4 language, it's specific to Visual Studio. We could support it for compatibility, but that's a bit of a rabbit hole. This particular use isn't really necessary anyway, since the include paths are relative to the file that does the include.
I think a better solution, if one is needed, would be to provide a default MSBuild/xbuild Task for running Mono.TextTemplating. Then you can let MSBuild/xbuild resolve the ProjectDir property before sending it to the TextTemplating engine.
@Staffan: that's not really how it works. The T4 engine asks the host (which could be VS, XS, MSBuild tasks, TextTransform.exe, etc) to resolve a path string to an actual path. The VS host chose to implement this by interpreting MSBuild-style substitutions. I could easily implement the same thing in the XS host but I could not guarantee the available substitutions about the the same, which could cause compatibility problems (both ways).
This was actually implemented already - https://github.com/mono/monodevelop/commit/7883cde9e11088e1ab2fd042a44e2ed4b64a6cf5