{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/6092","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/6092/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/6092/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/6092/events","html_url":"https://github.com/dotnet/corefx/issues/6092","id":133394264,"number":6092,"title":"MemoryMappedFile.CreateFromFile not able to open file for read","user":{"login":"schellap","id":10644403,"avatar_url":"https://avatars.githubusercontent.com/u/10644403?v=3","gravatar_id":"","url":"https://api.github.com/users/schellap","html_url":"https://github.com/schellap","followers_url":"https://api.github.com/users/schellap/followers","following_url":"https://api.github.com/users/schellap/following{/other_user}","gists_url":"https://api.github.com/users/schellap/gists{/gist_id}","starred_url":"https://api.github.com/users/schellap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schellap/subscriptions","organizations_url":"https://api.github.com/users/schellap/orgs","repos_url":"https://api.github.com/users/schellap/repos","events_url":"https://api.github.com/users/schellap/events{/privacy}","received_events_url":"https://api.github.com/users/schellap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/System.IO","name":"System.IO","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/6","html_url":"https://github.com/dotnet/corefx/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/6/labels","id":1365455,"number":6,"title":"1.0.0-rc2","description":"","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":60,"closed_issues":432,"state":"open","created_at":"2015-10-20T04:29:15Z","updated_at":"2016-02-16T18:20:50Z","due_on":"2016-02-02T08:00:00Z","closed_at":null},"comments":12,"created_at":"2016-02-13T03:36:19Z","updated_at":"2016-02-16T19:27:57Z","closed_at":"2016-02-15T20:05:48Z","body":"@stephentoub, my changes for ILC integration with CLI https://github.com/dotnet/cli/pull/1363 failed in the CI. Is the below by design?\r\n\r\nI narrowed it down to this scenario: XUnit runner process and the ILC's input project both refer to the same version of the NETStandard.Library. XUnit runner loads System.Console.dll from the shared packages cache location. ILC wants to compile an user's app using the same System.Console.dll specified in the project.json file and opens a `MemoryMappedFile` on it which errors out with:\r\n\r\n```\r\nThe process cannot access the file 'C:\\Users\\schellap\\.nuget\\packages\\runtime.win7.System.Console\\4.0.0-rc2\r\n-23811\\runtimes\\win7\\lib\\dotnet5.4\\System.Console.dll' because it is being used by another process.\r\n```\r\n\r\nTo repro,\r\n\r\n1. Download [CLI](https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/Latest/dotnet-win-x64.latest.zip) and unzip into c:\\cli\r\n2. `set DOTNET=c:\\cli`\r\n3. Unzip this zip file [temp2.zip](https://github.com/dotnet/corefx/files/128969/temp2.zip) or use below code.\r\n4. Run repro.bat from the zip file.\r\n5. Unexpected result.\r\n\r\n\r\n```\r\n        public static int Main(string[] args)\r\n        {\r\n            MemoryMappedFile mappedFile = null;\r\n            while (true) try\r\n            {\r\n                mappedFile = MemoryMappedFile.CreateFromFile(args[0], FileMode.Open, null, 0, MemoryMappedFileAccess.Read);\r\n                Console.WriteLine(\"Expected\");\r\n                return 100;\r\n            }\r\n            catch (IOException e)\r\n            {\r\n                Console.WriteLine(\"Unexpected \" + e.Message);\r\n            }\r\n            finally\r\n            {\r\n                if (mappedFile != null)\r\n                    mappedFile.Dispose();\r\n            }\r\n            return -1;\r\n        }\r\n```\r\n\r\n```\r\n:: populate the shared location\r\n%DOTNET%\\bin\\dotnet.exe restore\r\n\r\n:: compile the app\r\n%DOTNET%\\bin\\dotnet.exe publish\r\n\r\n:: delete system.console so shared system.console will be used\r\nif exist \"bin\\Debug\\dnxcore50\\win7-x64\\System.Console.dll\" (del  \"bin\\Debug\\dnxcore50\\win7-x64\\System.Console.dll\")\r\n\r\n:: run the process\r\nbin\\Debug\\dnxcore50\\win7-x64\\temp2.exe %USERPROFILE%\\.nuget\\packages\\runtime.win7.System.Console\\4.0.0-rc2-23811\\runtimes\\win7\\lib\\dotnet5.4\\System.Console.dll\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/184842611","html_url":"https://github.com/dotnet/corefx/issues/6092#issuecomment-184842611","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/6092","id":184842611,"user":{"login":"schellap","id":10644403,"avatar_url":"https://avatars.githubusercontent.com/u/10644403?v=3","gravatar_id":"","url":"https://api.github.com/users/schellap","html_url":"https://github.com/schellap","followers_url":"https://api.github.com/users/schellap/followers","following_url":"https://api.github.com/users/schellap/following{/other_user}","gists_url":"https://api.github.com/users/schellap/gists{/gist_id}","starred_url":"https://api.github.com/users/schellap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schellap/subscriptions","organizations_url":"https://api.github.com/users/schellap/orgs","repos_url":"https://api.github.com/users/schellap/repos","events_url":"https://api.github.com/users/schellap/events{/privacy}","received_events_url":"https://api.github.com/users/schellap/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T19:27:57Z","updated_at":"2016-02-16T19:27:57Z","body":"Why not change both and update MSDN with a note or just update MSDN with a note? It should be useful to have two instances to open a file for read in both. This is only a relaxing change and if it is trivial I don't quite understand @weshaggard's hesitation."}}