I read a blog post recently about using .NET in NAV (which, unfortunately, I can't find now). In it the author explained how easy it was to use .NET by creating a variable of type DotNet. The example he gave was using System.IO.Path to combine a directory and filename to get a full path without worrying about the presence or absence of a backslash in between.
System.IO.Path also has some functions that I'd like to use now to split a path into directory and filename parts. However, NAV 2009 R2 is not listing System.IO.Path as an available assembly.
What I've done is create a global variable, of type DotNet, drill down on the Subtype, then drill down on the Assembly. I've got a long list of assemblies on the .NET tab, including System.IO.Log, but not System.IO.Path. I have Microsoft .NET framework 4.5.1 installed on my computer (though the original article said that System.IO.Path should be included by default in Windows 7).
What am I missing? How can I create a System.IO.Path variable?
Thanks,
Randy
Answers
But here the way to get the assembly name for a .NET class of the standard framework:
- Search in the MSDN for the class you want to use (http://msdn.microsoft.com/en-us/library ... .file.aspx)
- Select the Framework Version you want to use (.NET 2 .. 4.5)
- Look for the Assembly, in this case: mscorlib (in mscorlib.dll)
- Search in the list of assemblies in NAV for the given name
http://www.sist.biz/en/ [en] | http://www.sist.biz [de]