How can i read file from FileShare. When i change filepath to local machine it works perfect, but when i change it to UNS path to SharedFolder, it wont work. And it throws an error System.IO.Exception
var filePath = @"\\192.168.150.11\Tine Integrasjon\Riversand\Riversand.xml";
var test = File.OpenRead(filePath);
FileInfo file = new FileInfo(filePath);
FileStream fs = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
logger.WriteLine("Det finnes ingen fil å lese fra, sjekk mappen 'Riversand'", DateTime.Now.ToString());
catch (Exception e)
logger.WriteLine("Failed to run application.", e.Message + Environment.NewLine + e.StackTrace);
iam getting Exception: System.IO.IOException " The user name or password is incorrect".
Visual studio is running as Administrator, an user have read /Write permission on SharedFolder.
Iam running my development enviroment on Windows Server 2012 R2, and another VM in same domain with SharedFolder. And Firewall is diabled in all domain.!
If i just paste UNC Path (\\192.168.150.11\Tine Integrasjon\Riversand\Rive
in FIleExplorer, it opens the file, without any issue on authenticating. But when iam running my Console Application and i try to read the file i get an error : The username or password is inncorrect...