BC22 OnPrem .net6 Dictionary issue

xdimidrolx
Member Posts: 6
in General Chat
Hi all,
Having an issue with our solution with BC22 specifically .net lib "System.Collections.Generic.Dictionary`2"
Based on the information provided in the article https://demiliani.com/2023/03/21/dynamics-365-business-central-and-net-6/ , it has come to our attention that Business Central version 22 (BC22) brings about significant changes related to the .NET framework. Consequently, we made adjustments on our end by updating the "al.assemblyProbingPaths" to accommodate .NET6.
However, we encountered an issue during compilation that is consistent with the problem we faced during the compiling process. The error message and details are shown in the following image:
image
"message": "The call is ambiguous between the method 'Dictionary(DotNet \"System.Collections.Generic.IDictionary<System.Object, System.Object>\")' defined in DotNet 'System.Collections.Generic.Dictionary<System.Object, System.Object>' by the extension '123' and the method 'Dictionary(DotNet \"System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>>\")' defined in DotNet 'System.Collections.Generic.Dictionary<System.Object, System.Object>' by the extension '123'
Does anyone encounter such or similar issues? How possible to avoid the ambiguous call?
Please advise on this matter.
Having an issue with our solution with BC22 specifically .net lib "System.Collections.Generic.Dictionary`2"
Based on the information provided in the article https://demiliani.com/2023/03/21/dynamics-365-business-central-and-net-6/ , it has come to our attention that Business Central version 22 (BC22) brings about significant changes related to the .NET framework. Consequently, we made adjustments on our end by updating the "al.assemblyProbingPaths" to accommodate .NET6.
However, we encountered an issue during compilation that is consistent with the problem we faced during the compiling process. The error message and details are shown in the following image:
image

"message": "The call is ambiguous between the method 'Dictionary(DotNet \"System.Collections.Generic.IDictionary<System.Object, System.Object>\")' defined in DotNet 'System.Collections.Generic.Dictionary<System.Object, System.Object>' by the extension '123' and the method 'Dictionary(DotNet \"System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>>\")' defined in DotNet 'System.Collections.Generic.Dictionary<System.Object, System.Object>' by the extension '123'
Does anyone encounter such or similar issues? How possible to avoid the ambiguous call?
Please advise on this matter.
0
Answers
-
Hi,
In your case you probably don't need to specify any parameter for the constructor, as I don't believe that you want to copy "gDNe_DataColumns" dictionary values to (the same) "gDNe_DataColumns" dictionary variable.
You should be fine, when you just simply do:gDNe_DataColumns := gDNe_DataColumns.Dictionary();
Then you don't have ambiguous calls.
Just out of curiosity, why don't you just use the standard AL Dictionary variable such as:local procedure DictionaryTest() var MyDictionary: Dictionary of [Text, Text]; begin MyDictionary.Add('x', 'y'); end;
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions