AL
AL copied to clipboard
Presence of unrelated XML file(s) causes AppSourceCop/PTECop rules AS0094/PTE0014 to throw exceptions instead of just ignoring them
Having unrelated XML files that aren't for permissions in a repository is problematic because these Cops try to scan them, find stuff they don't expect, and crash.
They should instead simply ignore such files, and give up trying to interpret them as permissions XMLs... if they clearly cannot be, because they have a structure/properties that a permissions XML would not have.
Please fix :-) and many thanks!
full text 1:
Analyzer 'Microsoft.Dynamics.Nav.AppSourceCop.Configuration.Rule094PermissionSetsShouldNotBeInXML' threw an exception of type 'System.Xml.XmlException' with message 'System.Xml.XmlException: System does not support 'Windows-1252' encoding. Line 1, position 31.
---> System.ArgumentException: 'Windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name')
at System.Text.EncodingTable.InternalGetCodePageFromName(String name)
at System.Text.EncodingTable.GetCodePageFromName(String name)
at System.Text.Encoding.GetEncoding(String name)
at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
--- End of inner exception stack trace ---
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at Microsoft.Dynamics.Nav.Analyzers.Common.FileSystemExtensions.GetPermissionSetDocuments(IFileSystem fileSystem)+MoveNext() in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.Analyzers.Common\FileSystemExtensions.cs:line 27
at Microsoft.Dynamics.Nav.AppSourceCop.Configuration.Rule094PermissionSetsShouldNotBeInXML.ReportWarningsForXMLPermissionSets(CompilationAnalysisContext ctx) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.AppSourceCop\Configuration\Rule094PermissionSetsShouldNotBeInXML.cs:line 29
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass48_1.<ExecuteCompilationActionsCore>b__0() in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 618
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1102'
full text 2:
Analyzer 'Microsoft.Dynamics.Nav.PerTenantExtensionCop.Rule014PermissionSetsShouldNotBeInXML' threw an exception of type 'System.Xml.XmlException' with message 'System.Xml.XmlException: System does not support 'Windows-1252' encoding. Line 1, position 31.
---> System.ArgumentException: 'Windows-1252' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name')
at System.Text.EncodingTable.InternalGetCodePageFromName(String name)
at System.Text.EncodingTable.GetCodePageFromName(String name)
at System.Text.Encoding.GetEncoding(String name)
at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
--- End of inner exception stack trace ---
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.CheckEncoding(String newEncodingName)
at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at Microsoft.Dynamics.Nav.Analyzers.Common.FileSystemExtensions.GetPermissionSetDocuments(IFileSystem fileSystem)+MoveNext() in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.Analyzers.Common\FileSystemExtensions.cs:line 27
at Microsoft.Dynamics.Nav.PerTenantExtensionCop.Rule014PermissionSetsShouldNotBeInXML.ReportWarningsForXMLPermissionSets(CompilationAnalysisContext ctx) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.PerTenantExtensionCop\Rules\Rule014PermissionSetsShouldNotBeInXML.cs:line 29
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass48_1.<ExecuteCompilationActionsCore>b__0() in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 618
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1102'
AL extension:
Name: AL Language
Id: ms-dynamics-smb.al
Description: AL development tools for Dynamics 365 Business Central
Version: 10.0.687650
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al