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:
parent
5f52644061
commit
859058ba7b
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue