-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T4 template doesn't run in "T4DocoptNetHostApp" #75
Comments
I have tried adding |
I have initially tried to mitigate the problem by having the path correctly set in the NuGet install.ps1 script. The approach is brittle, but it provides some mitigation for the fresh package installs. Looking at this again, this is not supported anymore in VS 2017+ - I will dig a bit deeper. |
I wonder though how that'll sit with a non-SDK-style project that targets .NET Framework. I do find what's being attempted with T4 is somewhat split & partial given that some code generation happens in the library: docopt.net/src/DocoptNet/Pattern.cs Lines 16 to 19 in 7a74df3
Perhaps it's time to look for a fresh approach to the problem? Perhaps something that's done via an MSBuild task? I don't have any proposal off the top of my head at the moment. |
Yes I agree. I am a bit disconnected from the .net world. How popular is T4 nowadays? |
Can't speak for everyone, but I think it's fine if used in a limited way that's not connected to the IDE and works cross-platform via mono/t4. I think what people love about T4 is the quick inner dev loop with saving and seeing the generated code/text update almost immediately. I wish |
Yes I would rather invest in the source code generator as well. |
Closing since T4 support was removed in PR #136. |
When running the custom tool from within VS, it fails with the following error:
on line 62 of
T4DocoptNet.tt
:docopt.net/src/T4DocoptNetHostApp/T4DocoptNet.tt
Line 62 in 2ac8437
It looks like I broke something with PR #59 in spite of testing on my end. 😞
The error message makes sense and while it looks like other people are running into a similar using libraries targeting .NET Standard in T4, I don't see a good solution yet. Even if we manage to find a workaround, I think the following line is going to be troublesome:
docopt.net/src/T4DocoptNetHostApp/T4DocoptNet.tt
Line 20 in 2ac8437
It means, targets will have to be added and maintained across all supported runtimes, including .NET Framework, .NET Core and .NET 5+, which seems too burdensome.
One option to explore would be to use mono/t4 that's now available as a tool. The integration with VS may not be as sweet though but that could be worked around with some sort of a watcher tool.
The text was updated successfully, but these errors were encountered: