UNC with dotnet core

Dani_S 3,316 Reputation points

I'm new with UNC with core.
Can you give some libs to work with UNC folder in core?
Thanks in advance,

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,138 questions
0 comments No comments
{count} votes

9 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,101 Reputation points

    UNC paths are for windows clients only.

    on MacOs and Linux, remotes are mounted to the filesystem, at any directory level you desire. to access window shares you use smb utilties and mount the share (typically with the mount cli). you can also use auto mount to only mount when in use. once mounted, the share is accessed as any folder.

    on MacOs SMB support is builtin. use "Finder->Go->Connect to Server... " and use the smb: protocol (mounts to /Volumes)

    smb://<servername>/<fileshare path>

    you can also just use the mount cli to mount a smb volume to a mount point, or just: open "smb://<servername>/<fileshare path>" which mounts to /Volumes via finder.

    on Linux, install smb file support (if not installed), and see the instruction for the distro chosen. for example on redhat:


    1 person found this answer helpful.
    0 comments No comments

  2. Bruce (SqlWork.com) 61,101 Reputation points
    0 comments No comments

  3. Dani_S 3,316 Reputation points

    Thanks for answer,
    How do I connect to UNC folder with credentials using cross platform code ?

    0 comments No comments

  4. Dani_S 3,316 Reputation points

    Thanks for your answer,
    Is it possible to connect to UNC folder with credentials using core library in all platforms (Mac && Linux) in C#?

    0 comments No comments

  5. Bruce (SqlWork.com) 61,101 Reputation points

    No. To access a UNC share on MacOS or Linux, you need to mount the share into the file system. Once mounted, the share is accessed like any file.

    So before running your program the share need mounting.

    Note: you could probably find a SMB client library that your code could use.

    0 comments No comments