【发布时间】:2012-04-26 17:55:38
【问题描述】:
我正在尝试让协议缓冲区与该 protobuf-csharp-port 一起使用。我想通过添加 .proto 文件并使用自定义工具进行自动构建,然后获取 .cs 文件。对于自定义工具,我被指示从 csharp-test 包中获取 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 发生。
或者即使有一种不太复杂的方法可以让 Progen 从 F7 运行,那也很好。
【问题讨论】:
-
如果该问题的公认答案不是安装其他 protobuf/c# 解决方案,我会很激动。就像我对这个兔子洞有多深感到懊恼。
-
啊……是的。您是否尝试过查看 CmdTool 的输出窗口和日志文件? (help.csharptest.net/?CmdToolVisualStudio.html)
-
是的,上面显示的错误信息来自 CmdTool。
标签: c# visual-studio-2008 msbuild