Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual Studio 2013预览版,Google Test Runner无法加载文件或程序集F#_F#_Googletest_Visual Studio 2013 - Fatal编程技术网

Visual Studio 2013预览版,Google Test Runner无法加载文件或程序集F#

Visual Studio 2013预览版,Google Test Runner无法加载文件或程序集F#,f#,googletest,visual-studio-2013,F#,Googletest,Visual Studio 2013,在尝试将单元测试添加到当前项目时,我遇到了VisualStudio2012和2013的插件。但是,当我尝试使用此选项运行测试时,我遇到以下错误: ------ Run test started ------ Found 2 tests, resolving symbols Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe Retrieving

在尝试将单元测试添加到当前项目时,我遇到了VisualStudio2012和2013的插件。但是,当我尝试使用此选项运行测试时,我遇到以下错误:

------ Run test started ------
Found 2 tests, resolving symbols
Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe
Retrieving the COM class factory for component with CLSID {BCE36434-2C24-499E-BF49-8BD99B0EEB68} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Running: C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe --gtest_output=xml:C:\Users\MYUSER\AppData\Local\Temp\tmpB2DE.tmp 
Opened results from C:\Users\MYUSER\AppData\Local\Temp\tmpB2DE.tmp
Could not load file or assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at FSharp.Data.RuntimeImplementation.XmlOperations.GetChildrenArray(XmlElement value, String nameWithNS)
   at FSharp.Data.RuntimeImplementation.XmlOperations.ConvertArray[R](XmlElement xml, String nameWithNS, Func`2 f)
   at GoogleTestRunner.ResultParser.getResults(IMessageLogger logger, String outputPath, IEnumerable`1 testCases)
   at GoogleTestRunner.GoogleTestExecutor.runOnce(IFrameworkHandle framework, Boolean debug, FSharpList`1 cases, String executable, Boolean runAll)
   at GoogleTestRunner.GoogleTestExecutor.runTests(IEnumerable`1 tests, IRunContext runContext, IFrameworkHandle framework, Boolean runAll)
No test is available in C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
========== Run test finished: 0 run (0:00:04.7380291) ==========
我不了解F#,也不知道是什么问题造成的,也不知道如何解决,页面上说它与Visual Studio 2013兼容。测试可以在文本资源管理器中正确发现和查看,但不会运行

编辑: 有时在构建之后,我会得到以下结果:

------ Discover test started ------
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\MY PROJECT.exe match [Tt]est[s]{0,1}.exe: false
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\Tests.exe match [Tt]est[s]{0,1}.exe: true
Found 2 tests, resolving symbols
Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\Tests.exe
Retrieving the COM class factory for component with CLSID {BCE36434-2C24-499E-BF49-8BD99B0EEB68} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\WorldServer.exe match [Tt]est[s]{0,1}.exe: false
========== Discover test finished: 2 found (0:00:00.2372256) ==========
FSharp.Core,版本=4.3.0.0

这是VS2012和F#3.0附带的版本。带有F#3.1的VS2013具有FSharp.Core V4.3.1.0


确保将F#项目的项目设置设置为使用正确且一致的F#运行时版本。

尝试安装此NuGet软件包:

我想你只需要F#runtime

编辑:根据Layl Conway,这是允许Google Test Runner运行的实际需要:

编辑2:为了完整起见,还有这篇博文(从答案到):

对于不耐烦的人:

单击直接下载链接( (如果你太忙) 下载的VWD_FSharp.msi只有7.55MB,不包括Azure 工具,VS和所有其他东西。建造工作,宇宙是正确的 再说一遍


你们安装了F#吗?我不确定它是否默认安装在VS 2012中。虽然我认为它是在VS 2013的新项目窗口中,但它显示我可以创建一个F#项目,因此我假设它已安装。F#自VS 2010以来默认包含在“专业”和更高的SKU中。@LaylConway如果我们任何一方回答了您的问题,通常会将答案标记为“已接受”供以后可能找到问题和答案的其他人参考。如果我们两人都没有回答你的问题,也许你可以提供一些额外的信息?正如我在Richard的回答下的评论中所说的那样,我们两人都没有回答这个问题,我并没有试图构建一个包含F#代码的项目。我尝试使用Fuxy中的VisualStudio插件。这不是我的项目,我试图在包含谷歌测试单元测试的本地C++项目上运行谷歌测试转发器插件。安装“VisualStudioExpress 2012的Web工具F”工具解决了VS 2015的相同问题!