Buildalyzer-AnalyzerManger ProjectFile-RequiresNetFramework属性为.vbproj引发null异常

时间:2019-05-29 09:14:08

标签: .net-core roslyn

Buildalyzer-AnalyzerManger ProjectFile-RequiresNetFramework属性为.vbproj抛出空异常

但是它适用于.csproj,只有.vbproj例外。

AnalyzerManager analyzerManager = new AnalyzerManager("C:\Users\\...\\source\\repos\\WebSite1\\WebSite1.sln");
ProjectAnalyzer projectAnalyzer = analyzerManager.GetProject("D:\\vb2\\ConsoleApp1\\ConsoleApp1.vbproj");
var analyzerResults = projectAnalyzer.Build();

对于.csproj来说,它工作正常,并且将值“ RequiresNetFramework”属性设置为false,并按预期方式构建了项目。但是对于.vbproj projectAnalyzer.Build();,在构建项目时会引发null异常。

例外: Exception image

堆栈跟踪:

at Buildalyzer.Construction.ProjectFile.<>c__DisplayClass14_0.<get_RequiresNetFramework>b__2(String i)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at Buildalyzer.Construction.ProjectFile.get_RequiresNetFramework()
   at Buildalyzer.Environment.EnvironmentFactory.GetBuildEnvironment(String targetFramework, EnvironmentOptions options)
   at Buildalyzer.ProjectAnalyzer.Build(String targetFramework)

0 个答案:

没有答案