microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
719 stars 242 forks source link

ALDoc Exception if app name contains illegal folder chars #7723

Open mjmatthiesen opened 2 months ago

mjmatthiesen commented 2 months ago

Please include the following with each issue:

1. Describe the bug Create an app, name it something that includes an illegal symbol for a folder, e.g. a colon :

2. To Reproduce Steps to reproduce the behavior:

  1. Create an app and add a colon to the name
{
  "name": "Example: The App",
}
  1. Run the init command of al doc
  2. Run the build command
  3. Error
Unhandled exception. System.IO.IOException: The directory name is invalid. : 'C:\Users\username\Desktop\Temp\DocGen\docs\reference\example:-the-app'
   at System.IO.FileSystem.CreateDirectory(String fullPath, Byte[] securityDescriptor)
   at System.IO.Directory.CreateDirectory(String path)
   at Microsoft.Dynamics.Nav.Documentation.Build.SetApiOutputDir(String path) in X:\Prod\aldoc\Build\Build.cs:line 130
   at Microsoft.Dynamics.Nav.Documentation.Build.Initialize() in X:\Prod\aldoc\Build\Build.cs:line 113
   at Microsoft.Dynamics.Nav.Documentation.RunImpl`1.Run() in X:\Prod\aldoc\RunImpl.cs:line 75
   at Microsoft.Dynamics.Nav.Documentation.Program.<>c.<Main>b__0_2(BuildOptions opts) in X:\Prod\aldoc\Program.cs:line 27
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at Microsoft.Dynamics.Nav.Documentation.Program.Main(String[] args) in X:\Prod\aldoc\Program.cs:line 16

3. Expected behavior Strip invalid chars

4. Actual behavior Doesn't strip

5. Versions:

Final Checklist

Please remember to do the following:

Internal work item: AB#534250

sergiusignacius commented 2 months ago

Thank you for submitting the issue, we reproduced the issue on our end. Accepted.