I only get this error in Radzen Blazor Studio. Any ideas…?
Nothing changed in my .csproj nor Program.cs. I’ve Cleaned and Rebuilt the solution multiple times. I’ve restarted Blazor Studio multiple times and ran the analyzer that reports the same error. Seems like another temp location needs to be cleared…?
Analyzing {Full Solution Path} ...
Radzen.Server.CompilationFailedException: {Full Project Path}\Program.cs(33,23): error CS8801: Cannot use local variable or local function 'builder' declared in a top-level statement in this context.
at Radzen.Server.ProjectContext.Compile(Compilation compilation, AssemblyLoadContext context)
at Radzen.Server.ProjectContext.Compile(Compilation compilation)
at Radzen.Server.ProjectContext.b__101_1()
at Radzen.Server.LoggerExtensions.Measure[T](ILogger logger, String name, Func1 action) at Radzen.Server.ProjectContext.Rebuild(Boolean throwOnBuildError) at Radzen.Server.ProjectContext.Rebuild(Boolean throwOnBuildError) at Radzen.Server.LoggerExtensions.MeasureAsync(ILogger logger, String name, Func1 action)
at Radzen.Server.SolutionContext.BuildAllProjects(Boolean throwOnBuildError)
at Radzen.Server.SolutionContext.BuildAsync(String fileName, Boolean throwOnBuildError, String framework)
at Radzen.Server.SolutionFacade.LoadProject(String filePath, Boolean overrideLifeCycle, Boolean throwOnBuildError)
at Radzen.Server.LoggerExtensions.MeasureAsync[T](ILogger logger, String name, Func`1 action)
at Radzen.Server.ProjectAnalyzer.AnalyzeAsync(String path, IServiceProvider serviceProvider, Boolean parallel, Boolean all, Boolean load)
Finished with errors.