dotnet.al compile error system.xml

TallyHo
Member Posts: 417
Hi,
This is probably a no-brainer for any .net developer,
But I'm stuck again upgrading another C/AL solution to AL.
This is the content of my dotnet.al file, I obtained it by using txt2al.exe.
dotnet
{
assembly("System.xml")
{
Version='2.0.0.0';
Culture='neutral';
PublicKeyToken='b77a5c561934e089';
type("System.Xml.XmlDocument";SystemXmlDocument){}
type("System.Xml.XmlNodeList";SystemXmlNodeList){}
type("System.Xml.XmlNodeType";SystemXmlNodeType){}
type("System.Xml.XmlNamedNodeMap";SystemXmlNamedNodeMap){}
}
}
I added "target": "Internal" to app.json. This fixed most of the problems.
But the line assembly("System.xml") is still not compiling in Visual Studio.
Now this is probably just fixed by changing the, name or Version from 2.0.0.0 to something else.
But how do I know what name, version or PublicKeyToken to use?
This is probably a no-brainer for any .net developer,
But I'm stuck again upgrading another C/AL solution to AL.
This is the content of my dotnet.al file, I obtained it by using txt2al.exe.
dotnet
{
assembly("System.xml")
{
Version='2.0.0.0';
Culture='neutral';
PublicKeyToken='b77a5c561934e089';
type("System.Xml.XmlDocument";SystemXmlDocument){}
type("System.Xml.XmlNodeList";SystemXmlNodeList){}
type("System.Xml.XmlNodeType";SystemXmlNodeType){}
type("System.Xml.XmlNamedNodeMap";SystemXmlNamedNodeMap){}
}
}
I added "target": "Internal" to app.json. This fixed most of the problems.
But the line assembly("System.xml") is still not compiling in Visual Studio.
Now this is probably just fixed by changing the, name or Version from 2.0.0.0 to something else.
But how do I know what name, version or PublicKeyToken to use?
0
Best Answer
-
Solved by changing VS user settings, now I can compile:
{
"al.assemblyProbingPaths": [
"./.netpackages",
"c:/Windows/assembly/",
"C:/Program Files/Microsoft Dynamics 365 Business Central/130/Service/Add-ins"
]
}
https://www.hougaard.com/dotnet-with-extensions-v2/
mscorlib always works, all the others have to be defined by user setting0
Answers
-
Hi TallyHo,
When you design the object i C/Side, can you go look at the dotnet assembly, there you can see if there is a newere version of the same assembly. Properly there is a 4.0.0.0. But what error are you getting in VS Code?For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0 -
Hi SanderDk,
System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Is what is in C/Side. So I changed the version in VS to 4.0.0.0.
That is not working.
This is the error I get in VS
[AL] An assembly named 'System.xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be found in the assembly probing paths 'c:\Users\[User]\Documents\AL\[project folder]\./.netpackages' [AL0451]
.NET Assembly "System.xml"
0 -
Try:
For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.0 -
I Tried this, it makes a difference. But not for the better:
[AL] An assembly named 'System.Xml, Version=4.0.0.0, PublicKeyToken=null' could not be found in the assembly probing paths 'c:\Users\[User]\Documents\AL\[project folder]\./.netpackages' [AL0451]
.NET Assembly "System.Xml"
It seems like the PublicKeyToken cannot be read at all now.
the mscorlib assembly doesn't have this problem.0 -
0 -
0 -
At last..
0 -
Solved by changing VS user settings, now I can compile:
{
"al.assemblyProbingPaths": [
"./.netpackages",
"c:/Windows/assembly/",
"C:/Program Files/Microsoft Dynamics 365 Business Central/130/Service/Add-ins"
]
}
https://www.hougaard.com/dotnet-with-extensions-v2/
mscorlib always works, all the others have to be defined by user setting0 -
> @TallyHo said:
> Solved by changing VS user settings, now I can compile:
>
> {
> "al.assemblyProbingPaths": [
> "./.netpackages",
> "c:/Windows/assembly/",
> "C:/Program Files/Microsoft Dynamics 365 Business Central/130/Service/Add-ins"
> ]
> }
>
> https://www.hougaard.com/dotnet-with-extensions-v2/
>
> mscorlib always works, all the others have to be defined by user setting
Nice catchFor help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.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