Project-system: Custom tools in the new project system

Created on 5 Dec 2016  路  3Comments  路  Source: dotnet/project-system

I'm not sure if this issue should go in msbuild or this repo, but is there/will there be support for "custom tools" in the new build system? By custom tool I mean the property you can set on a file in vs to run design time processing logic on a file, such as code generation.

I've seen that you can set a property called "custom tool" on _some_ files but not all, this creates a Generator tag in the project file, but i'm not quite sure what to put in there, or how to craft a nuget file so that my generator is run.

if there are any docs (or tracking issues) on that feature i'd greatly appreciate a link :) but perhaps that feature is not implemented yet

Most helpful comment

These single file generators are only run in VS. To run tools x-plat and in msbuild, you probably want to build a CLI tool. @piotrpMSFT do we have any docs on that?

All 3 comments

Yes single file generators are supported in the new project system. There is some documentation here - https://github.com/Microsoft/VSSDK-Extensibility-Samples/tree/master/Single_File_Generator

Interesting, @Srivatsn, that sample seems to be for vs2015 though, is the same syntax supported in vs2017? also, how are custom tools located in vs2017? in earlier versions聽you had to put them in the registry if i'm not mistaken, but I聽imagine now that things are a bit more cross plat, that is not longer the only option? ideally i'd want to put mine in a nuget package

Also, are custom tools only run by vs or also by msbuild? (so that they' would work cross plat/outside VS as well)

These single file generators are only run in VS. To run tools x-plat and in msbuild, you probably want to build a CLI tool. @piotrpMSFT do we have any docs on that?

Was this page helpful?
0 / 5 - 0 ratings