I have an xml file and my console app uses this file to convert it into Filestream using the code block:
FileStream fs = new FileStream(configFile, FileMode.Open)
But, when two instances/threads access above file on same instant/concurrently than it throws an exception which says as “Null reference exception”. Can someone please help me how can it be done, as I am struggling from a longer time to go out of it…
It solved my problem when I have used FileAccess.Read while converting it in FileStream