我有一个奇怪的错误,刚刚开始发生。尝试在NUnit中打开C#类库项目时,它会立即抛出异常:
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
答案 0 :(得分:1)
原来问题在于有太多“。”在项目名称中。
如果你有
的Nunit barfsName.Project.Something.SometingElse.csproj
它喜欢
Name.project.something.csproj