visual-studio-2010protobuf-netcustom-tools

protobuf-net custom tool inside solution directory?


I love that protobuf-net has a custom tool installed along with its installer.

However, my team uses an in-solution folder lib directory, under which you can find protobuf-net.

How can I register the custom tool target for this solution/my projects only, without doing any global changes to my VS2010 settings? I'm happy to hack my csproj/sln files as needed.

Thanks!


Solution

  • You can't. Custom tools in VS (i.e. via the item properties) are insanely hard coded. I would love it if this was easier to deploy, I really would - then I could deploy it with nuget. However, currently the only way to install a custom tool is with registry hacking, which requires an installer.

    I even pestered Phil Haack about it when we were both in Sweden, but: that option doesn't exist. I even looked into the other extension options new in VS2010 (via the extension manager), but I'm pretty sure these also don't include custom-tool support.

    However! If all you want is to be able to generate the files, then all you actually need to do is to execute protogen, specifying the .proto files to use as input. So if you are happy to change your csproj such that the build launches the protogen exe, that will probably suffice.

    Note that the protogen tool only does code-generation, and any code generated with the v1 version of protogen should still work fine if you are referencing the v2 library dll.