See the question and my original answer on StackOverflow

You could write a VS Macro that simply runs the custom tool when you need it. The automation method is VSProjectItem.RunCustomTool. Have a look at this answer on SO for a similar problem: Run Custom Tool for entire solution

Otherwise, PublicResXFileCodeGenerator is just a VS wrapper on the StronglyTypedResourceBuilder Class, that you can automate the way you want. I don't know if there is an Msbuild Task on top of it, but you also could write one, or you can just write a custom program in a pre build step. Here is an example on how to use this class: Strongly typed resources in ASP.NET