views:

33

answers:

1

Ok so I'm trying to hack together something to make SubSonic3 work with Postgres, on Mono.

I almost have the templates generating but have ran into one small problem.

<#@ include file="PostgreSQL.ttinclude" #>

will give a "cannot resolve include file" error.

However, specifying a full path will work(though cumbersome)

<#@ include file="/home/earlz/Projects/SubSonicPostgres/SubSonicPostgres/SubSonic/PostgreSQL.ttinclude" #>

Is there any kind of fix to this issue? Is it even a known bug?

+1  A: 

This is the first I've heard about it, and I wrote the MonoDevelop T4 engine :)

There's no trivial workaround, though since full source to MonoDevelop is available, you could easily patch it. Presumably the problem is that since the T4 engine is running inside the MD process, its working directory is MD's working directory. However, the host could easily override LoadIncludeText or ResolvePath to simulate a different working directory.

This really isn't the right place to report bugs - you're lucky I saw your post. You should ask on the MonoDevelop mailing list, and file bugs in the appropriate place.

mhutch
The thing is that I wasn't sure it was a bug, it could've been a configuration issue or something. Since you wrote the engine(*evil grin*)... As it is right now, if you want helper methods in an included file, you have to place all include directives at the bottom of the file. If they are at the top it throws a weird exception that helper methods aren't allowed after blocks or something like that... Is this planned to be fixed later?
Earlz
I didn't know that was an issue either. I built it using only info in public documentation, so there are probably several minor incompatibilities with MS' T4 engine. It was intended for handling the ASP.NET MVC templates - general-purpose use was a bonus. TBH it's not a high-priority MD feature - if you file bugs we can track the issues and I'll eventually get around to fixing them, but patches would be more useful :)
mhutch