AutoRunCustomTool icon indicating copy to clipboard operation
AutoRunCustomTool copied to clipboard

does not work for a tt file in a .net core lib

Open papiermache opened this issue 8 years ago • 14 comments

yes I know .net core is supposed to be platform independent command line biased and text editor friendly - great we're back to 1986. I need VS 2017 to run tt files that are in a .net core library, MS seem to have removed all T4 support, I was hoping your utility tool would save my life .. but doesn't seem to work either?

papiermache avatar Mar 03 '17 15:03 papiermache

Hi @papiermache,

Well, AutoRunCustomTool relies on VS support for custom tools, so if it's not supported in .NET Core projects, AutoRunCustomTool can't make it happen...

What kind of project is it, anyway? csproj or project.json ? I'm not surprised that it doesn't work for project.json, which has been abandoned anyway, but I expected it to work for csproj.

thomaslevesque avatar Mar 03 '17 16:03 thomaslevesque

Hi Thomas yes a csproj.

I’ve noticed that project.json seems to have disappeared, even though there are tons of blogs/articles/posting about it. How did you find out it was abandonned – I looked everywhere for this info but not found mention of this?

Regards, Rick.

From: Thomas Levesque [mailto:[email protected]] Sent: March 3, 2017 11:40 AM To: thomaslevesque/AutoRunCustomTool [email protected] Cc: Rick Piovesan [email protected]; Mention [email protected] Subject: Re: [thomaslevesque/AutoRunCustomTool] does not work for a tt file in a .net core lib (#18)

Hi @papiermachehttps://github.com/papiermache,

Well, AutoRunCustomTool relies on VS support for custom tools, so if it's not supported in .NET Core projects, AutoRunCustomTool can't make it happen...

What kind of project is it, anyway? csproj or project.json ? I'm not surprised that it doesn't work for project.json, which has been abandoned anyway, but I expected it to work for csproj.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/thomaslevesque/AutoRunCustomTool/issues/18#issuecomment-284003827, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFIumWP-n4bnoYPz63x3IHeKDgzdysqqks5riEJJgaJpZM4MSYEi.

papiermache avatar Mar 03 '17 17:03 papiermache

even though there are tons of blogs/articles/posting about it

Yeah, and now they're all obsolete :(

How did you find out it was abandonned – I looked everywhere for this info but not found mention of this?

It was mentioned in many places, but mostly in articles on the .NET blog, like this one

thomaslevesque avatar Mar 03 '17 17:03 thomaslevesque

very frustrating, thx for the blog reference ..

From: Thomas Levesque [mailto:[email protected]] Sent: March 3, 2017 12:23 PM To: thomaslevesque/AutoRunCustomTool [email protected] Cc: Rick Piovesan [email protected]; Mention [email protected] Subject: Re: [thomaslevesque/AutoRunCustomTool] does not work for a tt file in a .net core lib (#18)

even though there are tons of blogs/articles/posting about it

Yeah, and now they're all obsolete :(

How did you find out it was abandonned – I looked everywhere for this info but not found mention of this?

It was mentioned in many places, but mostly in articles on the .NET blog, like this onehttps://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-net-core-tools-msbuild-alpha/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/thomaslevesque/AutoRunCustomTool/issues/18#issuecomment-284015395, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFIumTjQjLpeMY1-tJ_YofJBpPs0Z0VSks5riExjgaJpZM4MSYEi.

papiermache avatar Mar 03 '17 17:03 papiermache

I investigated this, and... I have no idea what's going on. In the extender provider's GetExtender method, for an item in a "classic" project, I can get the FullPath property of the extendee object. But for an item in a "SDK-style" project, this property isn't available, and I can't get any useful information on the object besides the name of the file. I'm unable to find any useful documentation about this.

Could anybody help? @madskristensen? Sorry to drag you into this, but...

thomaslevesque avatar Mar 07 '19 16:03 thomaslevesque

Let's ask @jaredpar who might know about the SDK style project node paths?

madskristensen avatar Mar 07 '19 17:03 madskristensen

I don't have a lot of experience in this area. @sharwell may know this or where to route.

jaredpar avatar Mar 15 '19 22:03 jaredpar

The extender strategy won't work for SDK-style projects. For ANTLR, I had the benefit that I only wanted to extend my own item type(s), so I was able to implement the entire set of rules (properties) in https://github.com/tunnelvisionlabs/antlr4cs/pull/234. However, for simply adding a single property to the existing items in a project you are likely impacted by https://github.com/dotnet/project-system/issues/3608.

sharwell avatar Mar 16 '19 00:03 sharwell

@madskristensen @jaredpar thanks for helping find the right person!

@sharwell thanks. To be honest, I'm not very familiar with VS extensibility, I only made this extension work in the first place by trial and error. So I'm not sure I really understand the issue you linked to... Does it mean there's no way to add a custom property to items of a SDK-style project?

thomaslevesque avatar Mar 18 '19 02:03 thomaslevesque

Looks like the extension actually works partially for SDK-style projects. If you manually set the RunCustomToolOn property on an item in the csproj file, it works as expected. What doesn't work is that this property doesn't appear in the item's property window. This is not ideal, but at least it's not completely broken...

The property can be specified like this (for the example in the README):

<None Include="Trigger.txt">
    <RunCustomToolOn>Target.tt;Target2.tt</RunCustomToolOn>
</None>

Note: if the file was already included implicitly in the project, it won't appear in the csproj file. You can add it yourself, using Update instead of Include.

thomaslevesque avatar Feb 27 '22 16:02 thomaslevesque

Looks like the extension actually works partially for SDK-style projects. If you manually set the RunCustomToolOn property on an item in the csproj file, it works as expected. What doesn't work is that this property doesn't appear in the item's property window. This is not ideal, but at least it's not completely broken...

The property can be specified like this (for the example in the README):

<None Include="Trigger.txt">
    <RunCustomToolOn>Target.tt;Target2.tt</RunCustomToolOn>
</None>

Note: if the file was already included implicitly in the project, it won't appear in the csproj file. You can add it yourself, using Update instead of Include.

@thomaslevesque

Can this trigger a .tt file in the same solution but different project?

AdiThakker avatar Jan 20 '23 19:01 AdiThakker

Hi @AdiThakker,

I haven't touched this in a while, but no, I don't think so.

thomaslevesque avatar Jan 20 '23 20:01 thomaslevesque