2012-04-26 39 views
0

我試圖讓協議緩衝區與該protobuf-csharp端口去。我想通過添加.proto文件並使用自定義工具進行自動構建,然後獲取.cs文件。對於定製工具,我被要求從CmdTool中取出一個csharp-test包,並註冊它。獲取自定義生成工具來創建C#文件

這工作,但隨後運行該工具,我得到

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運行,這將是很好的。

+0

類似的問題:HTTP ://stackoverflow.com/questions/453820/protocol-buffers-in-c-sharp-projects-using-protobuf-net-best-practices-for-cod – heavyd 2012-04-26 22:38:29

+0

如果該問題的接受答案是不安裝另一個protobuf/c#解決方案我會很激動。正如我對這個兔子洞有多深深感到懊惱一樣。 – 2012-04-27 13:43:08

+0

啊..是的。您是否嘗試過查看CmdTool的輸出窗口和日誌文件? (http://help.csharptest.net/?CmdToolVisualStudio.html) – heavyd 2012-04-27 14:31:00

回答

1

我在Visual Studio 2008年我與工具的作者合作,獲得解決方案的確切同樣的問題,他的腳步爲我工作。

  1. 下載NuGet包 「Csharptest.net.tools」

  2. 運行 「工具/ net40/CmdTool.exe註冊」

  3. 重啓VStudio

相關問題