{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/dnx/issues/1612","labels_url":"https://api.github.com/repos/aspnet/dnx/issues/1612/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/dnx/issues/1612/comments","events_url":"https://api.github.com/repos/aspnet/dnx/issues/1612/events","html_url":"https://github.com/aspnet/dnx/issues/1612","id":66966960,"number":1612,"title":"dnu pack fails when project.json is readonly.","user":{"login":"phenning","id":2433750,"avatar_url":"https://avatars.githubusercontent.com/u/2433750?v=3","gravatar_id":"","url":"https://api.github.com/users/phenning","html_url":"https://github.com/phenning","followers_url":"https://api.github.com/users/phenning/followers","following_url":"https://api.github.com/users/phenning/following{/other_user}","gists_url":"https://api.github.com/users/phenning/gists{/gist_id}","starred_url":"https://api.github.com/users/phenning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phenning/subscriptions","organizations_url":"https://api.github.com/users/phenning/orgs","repos_url":"https://api.github.com/users/phenning/repos","events_url":"https://api.github.com/users/phenning/events{/privacy}","received_events_url":"https://api.github.com/users/phenning/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/dnx/labels/3%20-%20Done","name":"3 - Done","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/dnx/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"victorhurdugaci","id":5921642,"avatar_url":"https://avatars.githubusercontent.com/u/5921642?v=3","gravatar_id":"","url":"https://api.github.com/users/victorhurdugaci","html_url":"https://github.com/victorhurdugaci","followers_url":"https://api.github.com/users/victorhurdugaci/followers","following_url":"https://api.github.com/users/victorhurdugaci/following{/other_user}","gists_url":"https://api.github.com/users/victorhurdugaci/gists{/gist_id}","starred_url":"https://api.github.com/users/victorhurdugaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorhurdugaci/subscriptions","organizations_url":"https://api.github.com/users/victorhurdugaci/orgs","repos_url":"https://api.github.com/users/victorhurdugaci/repos","events_url":"https://api.github.com/users/victorhurdugaci/events{/privacy}","received_events_url":"https://api.github.com/users/victorhurdugaci/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/dnx/milestones/12","html_url":"https://github.com/aspnet/dnx/milestones/1.0.0-beta5","labels_url":"https://api.github.com/repos/aspnet/dnx/milestones/12/labels","id":1029681,"number":12,"title":"1.0.0-beta5","description":"","creator":{"login":"muratg","id":1808428,"avatar_url":"https://avatars.githubusercontent.com/u/1808428?v=3","gravatar_id":"","url":"https://api.github.com/users/muratg","html_url":"https://github.com/muratg","followers_url":"https://api.github.com/users/muratg/followers","following_url":"https://api.github.com/users/muratg/following{/other_user}","gists_url":"https://api.github.com/users/muratg/gists{/gist_id}","starred_url":"https://api.github.com/users/muratg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muratg/subscriptions","organizations_url":"https://api.github.com/users/muratg/orgs","repos_url":"https://api.github.com/users/muratg/repos","events_url":"https://api.github.com/users/muratg/events{/privacy}","received_events_url":"https://api.github.com/users/muratg/received_events","type":"User","site_admin":false},"open_issues":57,"closed_issues":72,"state":"open","created_at":"2015-03-19T17:13:11Z","updated_at":"2015-05-18T17:04:18Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2015-04-07T18:58:48Z","updated_at":"2015-05-18T18:40:26Z","closed_at":"2015-05-13T19:59:17Z","body":"When running dnu pack on a project where the project.json is a read-only file, the following exception and callstack is generated. This impacts SCC (TFS) scenarios where the project.json is not checked out.\r\n\r\n```\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : System.UnauthorizedAccessException: Access to the path 'c:\\users\\phenning\\documents\\visual studio 2015\\Projects\\artifacts\\bin\\ConsoleApp6\\Debug\\app\\project.json' is denied.\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at System.IO.File.WriteAllText(String path, String contents)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.InstallBuilder.ModifyJson(String jsonFile, Action`1 modifier)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.InstallBuilder.WriteApplicationProjectJsonFile(String applicationFolder)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.InstallBuilder.BuildApplicationFiles(String baseOutputPath)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.InstallBuilder.Build(String outputPath)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.BuildManager.Build()\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.Program.<>c__DisplayClass3_3.<Main>b__6()\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args)\r\n\r\n1>C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v14.0\\DNX\\Microsoft.DNX.targets(134,5): error : at Microsoft.Framework.PackageManager.Program.Main(String[] args)\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/dnx/issues/comments/103166076","html_url":"https://github.com/aspnet/dnx/issues/1612#issuecomment-103166076","issue_url":"https://api.github.com/repos/aspnet/dnx/issues/1612","id":103166076,"user":{"login":"Darkonekt","id":12500570,"avatar_url":"https://avatars.githubusercontent.com/u/12500570?v=3","gravatar_id":"","url":"https://api.github.com/users/Darkonekt","html_url":"https://github.com/Darkonekt","followers_url":"https://api.github.com/users/Darkonekt/followers","following_url":"https://api.github.com/users/Darkonekt/following{/other_user}","gists_url":"https://api.github.com/users/Darkonekt/gists{/gist_id}","starred_url":"https://api.github.com/users/Darkonekt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Darkonekt/subscriptions","organizations_url":"https://api.github.com/users/Darkonekt/orgs","repos_url":"https://api.github.com/users/Darkonekt/repos","events_url":"https://api.github.com/users/Darkonekt/events{/privacy}","received_events_url":"https://api.github.com/users/Darkonekt/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T18:40:26Z","updated_at":"2015-05-18T18:40:26Z","body":"nice thanks I will try it"}}