BC DotNet file/directory functions - access denied

hubi777
Member Posts: 8
Hello,
i am using BC OnPrem 18 (Cronus database) for testing.
At this time, i want to translate some file/directory code from NAV2013 to BC180 and got "access denied" errors.
C/AL: I can search all directories with dotnet „mscorelib“ functions without any problems.
AL: I can only search local but no external directories.
I think the problem seems to be the service user who searches the directories.
Can i change the behavior that BC uses the windows user for file actions?
dotnet
{
assembly(mscorlib)
{
type("System.Object"; Object) { }
type("System.IO.Directory"; IODirectory) { }
}
}
codeunit 50200 SearchData
{
:
var
FD_Object: DotNet Object;
FD_Dir: DotNet IODirectory;
NavDir: Text;
begin
NavDir := '\\fserver\data\';
FD_Object := FD_Verzeichnis.GetFiles(NavDir, '*.pdf');
:
end;
}
Thanks
i am using BC OnPrem 18 (Cronus database) for testing.
At this time, i want to translate some file/directory code from NAV2013 to BC180 and got "access denied" errors.
C/AL: I can search all directories with dotnet „mscorelib“ functions without any problems.
AL: I can only search local but no external directories.
I think the problem seems to be the service user who searches the directories.
Can i change the behavior that BC uses the windows user for file actions?
dotnet
{
assembly(mscorlib)
{
type("System.Object"; Object) { }
type("System.IO.Directory"; IODirectory) { }
}
}
codeunit 50200 SearchData
{
:
var
FD_Object: DotNet Object;
FD_Dir: DotNet IODirectory;
NavDir: Text;
begin
NavDir := '\\fserver\data\';
FD_Object := FD_Verzeichnis.GetFiles(NavDir, '*.pdf');
:
end;
}
Thanks
0
Answers
-
The service account that you start the NST must have access to that folder.
The client isn't handle that anymore because it is the webclient.
So if you give the NST user access to the folder it will be OK I think.0 -
Yes please make sure your Service Account has all the permissions, normally this is what I do I use to make the Service Account user as an admin.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/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