0

I'm trying to get protocol buffers going with that protobuf-csharp-port. I want to have an automatic build by adding the .proto file and using the Custom Tool, and then getting a .cs file. For custom tool, I'm instructed to get a CmdTool out of a csharp-test package, and register it.

That worked, but then running the tool I get

System.InvalidOperationException: Before a project can be instantiated, Engine.BinPath 
must be set to the location on disk where MSBuild is installed. This is used to evaluate 
$(MSBuildBinPath).
at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
at Microsoft.Build.BuildEngine.Project..ctor(Engine engine)
at CSharpTest.Net.CustomTool.VsInterop.CmdTool.GenerateCode(String defaultNamespace, 
  String inputFileName) in e:\Projects\Library\Tools\CmdTool\VsInterop\CustomTool.cs:line 50

I'm way out of my element, and can't seem to find any clue what to do, or how to get $(MSBuildBinPath) or Engine.BinPath happening.

Or even if there's a less-intricate way to get protogen running from F7, that would be nice.

Alan Baljeu
  • 2,383
  • 4
  • 25
  • 40
  • Similar question: http://stackoverflow.com/questions/453820/protocol-buffers-in-c-sharp-projects-using-protobuf-net-best-practices-for-cod – heavyd Apr 26 '12 at 22:38
  • If the accepted answer to that question wasn't to install the other protobuf/c# solution I would be thrilled. As is I'm chagrined over how deep this rabbit hole is going. – Alan Baljeu Apr 27 '12 at 13:43
  • Ahh.. yes. Have you tried looking at the output window and log files for CmdTool? (http://help.csharptest.net/?CmdToolVisualStudio.html) – heavyd Apr 27 '12 at 14:31
  • Yes, the error message shown above is from CmdTool. – Alan Baljeu Apr 27 '12 at 23:46

1 Answers1

1

I had the exact same problem in Visual Studio 2008. I worked with the author of the tool to get a solution and his steps worked for me.

  1. Download Nuget package "Csharptest.net.tools"

  2. Run "tools/net40/CmdTool.exe register"

  3. Restart VStudio

Michael
  • 101
  • 7