From 40ca476ea0a1956357aae55a8408df8ffdcc8215 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 14 Jan 2022 10:44:18 +0300 Subject: [PATCH 1/3] Cli: Fix blazor namespaces --- .../Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs index babfabdc56..a3637266bc 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs @@ -704,13 +704,13 @@ public class SolutionModuleAdder : ITransientDependency new NugetPackageInfo { Name = $"{module.Name}.Blazor.WebAssembly", - ModuleClass = $"{module.Name}.Blazor.{moduleProjectName}BlazorWebAssemblyModule", + ModuleClass = $"{module.Name}.Blazor.WebAssembly.{moduleProjectName}BlazorWebAssemblyModule", Target = NuGetPackageTarget.BlazorWebAssembly }, new NugetPackageInfo { Name = $"{module.Name}.Blazor.Server", - ModuleClass = $"{module.Name}.Blazor.{moduleProjectName}BlazorServerModule", + ModuleClass = $"{module.Name}.Blazor.Server.{moduleProjectName}BlazorServerModule", Target = NuGetPackageTarget.BlazorServer }, new NugetPackageInfo From 6ec11e1eb5861bdcf1487b81205c30d03c73ec96 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 14 Jan 2022 10:44:37 +0300 Subject: [PATCH 2/3] Cli: Class parsing should support File-Scoped Namespaces --- .../Abp/Cli/ProjectModification/DerivedClassFinder.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs index 52a2fb93b1..5462f3e9fb 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/DerivedClassFinder.cs @@ -54,8 +54,14 @@ public class DerivedClassFinder : ITransientDependency protected bool IsDerived(string csFile, string baseClass) { var root = CSharpSyntaxTree.ParseText(File.ReadAllText(csFile)).GetRoot(); - var namespaceSyntax = root.DescendantNodes().OfType().First(); - var classDeclaration = (namespaceSyntax.DescendantNodes().OfType()).First(); + var namespaceSyntax = root.DescendantNodes().OfType().FirstOrDefault(); + var classDeclaration = (namespaceSyntax?.DescendantNodes().OfType())?.FirstOrDefault(); + + if (classDeclaration == null) + { + classDeclaration = root.DescendantNodes().OfType().First(); + } + var baseTypeList = classDeclaration.BaseList?.Types.Select(t => t.ToString()).ToList(); if (baseTypeList == null) From 780f6af370e22cf30b0077c4172fb52666603863 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 14 Jan 2022 10:45:05 +0300 Subject: [PATCH 3/3] Cli: upgrade roslyn version --- framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj index 5ec6217ca2..2b2f815b7c 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj +++ b/framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj @@ -19,7 +19,7 @@ - +