2016-12-20 99 views
0

如何從騎士EAP運行統一單元測試?它在Unity中運行良好。騎士運行統一單元測試

Error:null: /Users/xxx/NavigationTest.sln : error : 
Target named 'Assembly-CSharp-Editor' not found in the project. 

但我可以建立在騎士-EAP解決方案:

,當我嘗試運行測試中,我得到這個錯誤。

SLN文件從Unity:

Microsoft Visual Studio Solution File, Format Version 11.00 
# Visual Studio 2008 

Project("{6394337E-A760-107E-A1B5-972965181127}") = "NavigationTest", "Assembly-CSharp.csproj", "{09AAC607-4433-B8FC-AE7F-1AD11A119684}" 
EndProject 
Project("{6394337E-A760-107E-A1B5-972965181127}") = "NavigationTest", "Assembly-CSharp-Editor.csproj", "{E38ED05D-5652-068C-C70B-013EED402A29}" 
EndProject 
Global 
    GlobalSection(SolutionConfigurationPlatforms) = preSolution 
     Debug|Any CPU = Debug|Any CPU 
     Release|Any CPU = Release|Any CPU 
    EndGlobalSection 
    GlobalSection(ProjectConfigurationPlatforms) = postSolution 
     {09AAC607-4433-B8FC-AE7F-1AD11A119684}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 
     {09AAC607-4433-B8FC-AE7F-1AD11A119684}.Debug|Any CPU.Build.0 = Debug|Any CPU 
     {09AAC607-4433-B8FC-AE7F-1AD11A119684}.Release|Any CPU.ActiveCfg = Release|Any CPU 
     {09AAC607-4433-B8FC-AE7F-1AD11A119684}.Release|Any CPU.Build.0 = Release|Any CPU 
     {E38ED05D-5652-068C-C70B-013EED402A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 
     {E38ED05D-5652-068C-C70B-013EED402A29}.Debug|Any CPU.Build.0 = Debug|Any CPU 
     {E38ED05D-5652-068C-C70B-013EED402A29}.Release|Any CPU.ActiveCfg = Release|Any CPU 
     {E38ED05D-5652-068C-C70B-013EED402A29}.Release|Any CPU.Build.0 = Release|Any CPU 
    EndGlobalSection 
    GlobalSection(SolutionProperties) = preSolution 
     HideSolutionNode = FALSE 
    EndGlobalSection 
    GlobalSection(MonoDevelopProperties) = preSolution 
     StartupItem = Assembly-CSharp.csproj 
    EndGlobalSection 
EndGlobal 

回答

1

右鍵單擊您的解決方案,並單擊「轉到源」,或雙擊錯誤表現出同樣的事情。你會得到這樣的事情:

# Visual Studio 2010 
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PROJECTNAME", "Assembly-CSharp.csproj", "{F9618595-3187-105D-65DC-297934AE12BE}" 
EndProject 
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PROJECTNAME", "Assembly-CSharp-Editor-firstpass.csproj", "{E7257D3B-0894-2E39-2141-C8FE4E9BCA6A}" 
EndProject 
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{C481669B-1E22-4D7C-8B33-7AB3A9D464FE}" 
EndProject 

該問題似乎與PROJECTNAME不等於項目名稱有關。重命名兩個PROJECTNAME條目以匹配其項目:

# Visual Studio 2010 
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{F9618595-3187-105D-65DC-297934AE12BE}" 
EndProject 
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor-firstpass", "Assembly-CSharp-Editor-firstpass.csproj", "{E7257D3B-0894-2E39-2141-C8FE4E9BCA6A}" 
EndProject 
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{C481669B-1E22-4D7C-8B33-7AB3A9D464FE}" 
EndProject 

然後,您可能可以運行測試。

此問題是discussed on GitHubtracked by Jetbrains

在應用此解決方法後,我確實遇到了this issue,但正如問題所示,第二次運行測試正常工作。

+0

我想配置騎士單元測試,但我面臨這個問題:http://stackoverflow.com/questions/44053289/adding-resource-file-for-testing-in-rider – ypriverol