I was trying to access a file with the user having only read permission. the code looked like:
FileStream fs =new FileStream(
"c:\path\to\file.ext",
FileMode.Open);
and it uset to throw exception “access denied”. After some investigations I’ve found that FileAccess.Read helps a lot.
FileStream fs = new FileStream(
"c:\path\to\file.ext",
FileMode.Open,
FileAccess.Read);
Check this link. It is a good way to deal with configuration sections in .NET environment.
Had a headache because of compilation of project which was using System.Data.SqlClient SortOrder data type. After some hours of investigations we found out that Microsoft .NET framework 2.0 SP1 was not installed on the machine. .NET 2.0 contains system.Data.SqlClient namespace but not SortOrder type in it. SP1 adds this data type to the namespace mentioned above.
Check this on microsoft.