GFlisch / Arc4u.Guidance.Doc

Other
5 stars 1 forks source link

(bug, Guidance 2022.2.1.11): code generation in interface project for new rest api controller is broken #151

Closed KrauseT closed 1 year ago

KrauseT commented 1 year ago

Describe the bug

  1. The generation of a Rest Api (Controller) in an interface project seems to use the facade project.
  2. In my case the generation of the first controller was no problem but every further controller just generates the domain and the v1 folder. With following error message: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\PRJ\git\PlaygroundTilo\BE\GameStore\PlaygroundTilo.GameStore.Facade\Dto\StoreDto.cs'. The file in the error message exists in the facade project. Perhaps he try to add the dto folder in the wrong project. (CallStack)

To Reproduce Steps to reproduce the behavior:

  1. Add a new interface project
  2. Add a new Rest Api (Controller)
  3. Wait for the generated code (the first code generation worked in my case)
  4. Add an other Rest Api (Controller)
  5. The new Folder for the domain and it's V1 folder are created but nothing else and you get an error in the console

Expected behavior The further controllers are generated as the first one. And the generation of the interface project should not know anything about the facade.

Screenshots image

Desktop:

Additional context CallStack System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\PRJ\git\PlaygroundTilo\BE\GameStore\PlaygroundTilo.GameStore.**Facade**\Dto\StoreDto.cs'. at GuidanceCore.Extensions.ProjectExtension.GetClasses(Project project) at GuidanceCore.Extensions.ProjectExtension.GetClassesImplementing(Project project, String interfaceString) at GuidanceCore.Commands.AddFacadeRestApiClassCommand.<OnExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at GuidanceCore.Commands.BaseGuidanceCommand1.d4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Community.VisualStudio.Toolkit.BaseCommand.<>cDisplayClass8_0.<b0>d.MoveNext() System.InvalidOperationException: Folder already exists with the name 'Dto' at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProjectItems.<>cDisplayClass2_0.<b0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject.<>cDisplayClass72_01.<<Mutate>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectNode.<>c__DisplayClass577_0.<<Mutate>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() at Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.ExecuteSynchronously(Func1 asyncAction) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject.Mutate[T](Func1 asyncAction, Boolean includesFileSystemChange, String telemetryActivity) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProjectItems.AddFolder(String name, String kind) at GuidanceCore.Extensions.PhysicalFolderExtensions.<GetOrAddFolderAsync>d__3.MoveNext()

rdarko commented 1 year ago

This will be tested / if needed fixed in the release 12

GFlisch commented 1 year ago

Hi @KrauseT, I have tested on the release 12 and it works. I propose t redo the test when I have release it.

KrauseT commented 1 year ago

This issue seems to be fixed with the new version.