Changing to use File.OpenRead. This is required because when access readonly files, you must pass FileAccess.Read, otherwise, we get a UnauthorizedFileAccess exception.

This commit is contained in:
Livar Cunha 2017-06-29 15:34:29 -07:00
parent 5f52644061
commit 859058ba7b

View file

@ -15,7 +15,7 @@ namespace Microsoft.DotNet.Cli.Utils
public RuntimeConfig(string runtimeConfigPath)
{
JObject runtimeConfigJson;
using (var streamReader = new StreamReader(new FileStream(runtimeConfigPath, FileMode.Open)))
using (var streamReader = new StreamReader(File.OpenRead(runtimeConfigPath)))
{
runtimeConfigJson = OpenRuntimeConfig(streamReader);
}