thomaslevesque / AutoRunCustomTool

A Visual Studio extension that automatically runs the custom tool on a file when a trigger file is modified
31 stars 13 forks source link

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

Open papiermache opened 7 years ago

papiermache commented 7 years ago

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?

thomaslevesque commented 7 years ago

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.

papiermache commented 7 years ago

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:notifications@github.com] Sent: March 3, 2017 11:40 AM To: thomaslevesque/AutoRunCustomTool AutoRunCustomTool@noreply.github.com Cc: Rick Piovesan rick.piovesan@detaya.com; Mention mention@noreply.github.com 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.

thomaslevesque commented 7 years ago

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

papiermache commented 7 years ago

very frustrating, thx for the blog reference ..

From: Thomas Levesque [mailto:notifications@github.com] Sent: March 3, 2017 12:23 PM To: thomaslevesque/AutoRunCustomTool AutoRunCustomTool@noreply.github.com Cc: Rick Piovesan rick.piovesan@detaya.com; Mention mention@noreply.github.com 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.

thomaslevesque commented 5 years ago

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...

madskristensen commented 5 years ago

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

jaredpar commented 5 years ago

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

sharwell commented 5 years ago

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.

thomaslevesque commented 5 years ago

@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 commented 2 years ago

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.

AdiThakker commented 1 year ago

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?

thomaslevesque commented 1 year ago

Hi @AdiThakker,

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