我在试着让协议缓冲器和原型机连接。我希望通过添加.proto文件并使用自定义工具进行自动构建,然后获得一个.cs文件。对于自定义工具,我被指示从csharp包中获取一个CmdTool,并注册它。
这很有效,但是运行我得到的工具
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我已经脱离了我的元素,似乎找不到任何线索去做什么,也找不出如何让$(MSBuildBinPath)或Engine.BinPath发生。
或者,即使有一种不那么复杂的方法从F7获得原生质体,那也很好。
发布于 2013-08-30 23:24:21
在Visual 2008中,我也遇到了同样的问题。我和这个工具的作者一起找到了一个解决方案,他的步骤也为我工作。
下载Nuget软件包"Csharptest.net.tools"
https://stackoverflow.com/questions/10338799
复制相似问题