{"action":"opened","issue":{"url":"https://api.github.com/repos/xunit/xunit/issues/656","labels_url":"https://api.github.com/repos/xunit/xunit/issues/656/labels{/name}","comments_url":"https://api.github.com/repos/xunit/xunit/issues/656/comments","events_url":"https://api.github.com/repos/xunit/xunit/issues/656/events","html_url":"https://github.com/xunit/xunit/issues/656","id":114454971,"number":656,"title":"Transforms should open files with FileShare.Read","user":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-01T06:58:21Z","updated_at":"2015-11-01T06:58:21Z","closed_at":null,"body":"The transform code today doesn't specify a `FileShare` mode when opening files and hence inherits the default of no sharing (even though the file is open with `FileMode.Read`).  This means two xunit processes can race for the ability to read this file and in such a case the loser will exit with the following error:\r\n\r\n```\r\n  System.IO.IOException: The process cannot access the file 'C:\\Users\\jaredpar\\.nuget\\packages\\xunit.runner.console\\2.1.0\\tools\\HTML.xslt' because it is being used by an\r\n  other process.\r\n     at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n     at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options,\r\n   SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n     at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)\r\n     at Xunit.ConsoleClient.TransformFactory.Handler_XslTransform(String xslPath, XElement xml, String outputFileName)\r\n     at Xunit.ConsoleClient.TransformFactory.<>c__DisplayClass2_1.<.ctor>b__1(XElement xml, String outputFileName)\r\n     at Xunit.ConsoleClient.TransformFactory.<>c__DisplayClass5_0.<GetXmlTransformers>b__1(XElement xml)\r\n     at Xunit.ConsoleClient.Program.<>c__DisplayClass10_0.<RunProject>b__5(Action`1 transformer)\r\n     at System.Collections.Generic.List`1.ForEach(Action`1 action)\r\n     at Xunit.ConsoleClient.Program.RunProject(XunitProject project, Boolean serialize, Nullable`1 parallelizeAssemblies, Nullable`1 parallelizeTestCollections, Nullable\r\n```\r\n\r\n"}}