2009-10-29 41 views
0

我有一個奇怪的錯誤,剛剛開始發生。當試圖在NUnit打開一個C#類庫項目立即拋出一個異常:無效的項目文件格式Nunit

System.NullReferenceException... 
at NUnit.Util.VSProject.LoadMSBuildProject(String projectDirectory, XmlDocument doc) 
at NUnit.Util.VSProject.LoadProject(String projectDirectory, XmlDocument doc) 
at NUnit.Util.VSProject.Load() 

System.ArgumentException... 
at NUnit.Util.VSProject.ThrowInvalidFormat(String projectPath, Exception e) 
at NUnit.Util.VSProject.Load() 
at NUnit.Util.VSProject..ctor(String projectPath) 
at NUnit.Util.ProjectConverters.VisualStudioConverter.ConvertFrom(String path) 
at NUnit.Util.ProjectService.ConvertFrom(String path) 
at NUnit.Util.ProjectService.LoadProject(String path) 
at NUnit.Util.TestLoader.LoadProject(String filePath, String configName) 

我們可以直接加載DLL文件並運行測試很好,但我不知道爲什麼,試圖加載時。 csproj文件,它會導致此崩潰。

我用:

NUnit的2.5.0

C#類庫.NET 3.5

回答

1

原來,問題是有太多的 「」以項目名稱。

NUnit的barfs如果你有

Name.Project.Something.SometingElse.csproj

它喜歡

Name.project.something.csproj