using (FileStream fs =
new FileStream(filePath,
FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
//...
http://msdn.microsoft.com/en-us/library/system.io.fileshare.aspx
Your log may be write locked, so try with FileShare.ReadWrite.
More Related Contents:
- How to use SqlClient in ASP.NET Core?
- TPL Dataflow, whats the functional difference between Post() and SendAsync()?
- Setting Button FlatStyle in WPF
- Run a Windows Service as a console app
- How to load navigation properties on an IdentityUser with UserManager
- Graphics on indexed image
- Process.Start(url) fails
- Who Disposes of an IDisposable public property?
- How to debug “Could not load file or assembly” runtime errors?
- Performance of compiled-to-delegate Expression
- How to get efficient Sql Server deadlock handling in C# with ADO?
- BinaryFormatter and Deserialization Complex objects
- When is it necessary/appropriate to use InAttribute and OutAttribute for COM Interop
- How to convert c# generic list to json using json.net?
- Winforms : How to bind the Checkbox item of a CheckedListBox with databinding
- Sharing variables between C# and C++
- Incorrect string value: ‘\xEF\xBF\xBD’ for column
- Run interactive command line exe using c#
- Programs randomly getting System.AccessViolationException
- How can I get a list Local Windows Users (Only the Users that appear in the windows Logon Screen)
- Passing object to different windows forms
- Shredding files in .NET
- How to use pipe in ffmpeg within c#
- Change the BackColor of the ToolStripSeparator control
- How to remove child one to many related records in EF code first database?
- NewtonSoft.Json Serialize and Deserialize class with property of type IEnumerable
- How do you Sort a DataTable given column and direction?
- What is “string[] args” in Main class for?
- Transactionscope throwing exception this platform does not support distributed transactions while opening connection object
- How to convert Arabic number to int?