{"action":"closed","issue":{"url":"https://api.github.com/repos/JanKallman/EPPlus/issues/184","repository_url":"https://api.github.com/repos/JanKallman/EPPlus","labels_url":"https://api.github.com/repos/JanKallman/EPPlus/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/JanKallman/EPPlus/issues/184/comments","events_url":"https://api.github.com/repos/JanKallman/EPPlus/issues/184/events","html_url":"https://github.com/JanKallman/EPPlus/issues/184","id":313521124,"node_id":"MDU6SXNzdWUzMTM1MjExMjQ=","number":184,"title":"In ExcelPackage CloseStream() results in System.ObjectDisposedException: Cannot access a closed Stream.","user":{"login":"KarlZ","id":884056,"node_id":"MDQ6VXNlcjg4NDA1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/884056?v=4","gravatar_id":"","url":"https://api.github.com/users/KarlZ","html_url":"https://github.com/KarlZ","followers_url":"https://api.github.com/users/KarlZ/followers","following_url":"https://api.github.com/users/KarlZ/following{/other_user}","gists_url":"https://api.github.com/users/KarlZ/gists{/gist_id}","starred_url":"https://api.github.com/users/KarlZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarlZ/subscriptions","organizations_url":"https://api.github.com/users/KarlZ/orgs","repos_url":"https://api.github.com/users/KarlZ/repos","events_url":"https://api.github.com/users/KarlZ/events{/privacy}","received_events_url":"https://api.github.com/users/KarlZ/received_events","type":"User","site_admin":false},"labels":[{"id":645220271,"node_id":"MDU6TGFiZWw2NDUyMjAyNzE=","url":"https://api.github.com/repos/JanKallman/EPPlus/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":{"login":"JanKallman","id":982881,"node_id":"MDQ6VXNlcjk4Mjg4MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/982881?v=4","gravatar_id":"","url":"https://api.github.com/users/JanKallman","html_url":"https://github.com/JanKallman","followers_url":"https://api.github.com/users/JanKallman/followers","following_url":"https://api.github.com/users/JanKallman/following{/other_user}","gists_url":"https://api.github.com/users/JanKallman/gists{/gist_id}","starred_url":"https://api.github.com/users/JanKallman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanKallman/subscriptions","organizations_url":"https://api.github.com/users/JanKallman/orgs","repos_url":"https://api.github.com/users/JanKallman/repos","events_url":"https://api.github.com/users/JanKallman/events{/privacy}","received_events_url":"https://api.github.com/users/JanKallman/received_events","type":"User","site_admin":false},"assignees":[{"login":"JanKallman","id":982881,"node_id":"MDQ6VXNlcjk4Mjg4MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/982881?v=4","gravatar_id":"","url":"https://api.github.com/users/JanKallman","html_url":"https://github.com/JanKallman","followers_url":"https://api.github.com/users/JanKallman/followers","following_url":"https://api.github.com/users/JanKallman/following{/other_user}","gists_url":"https://api.github.com/users/JanKallman/gists{/gist_id}","starred_url":"https://api.github.com/users/JanKallman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanKallman/subscriptions","organizations_url":"https://api.github.com/users/JanKallman/orgs","repos_url":"https://api.github.com/users/JanKallman/repos","events_url":"https://api.github.com/users/JanKallman/events{/privacy}","received_events_url":"https://api.github.com/users/JanKallman/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-04-11T23:24:47Z","updated_at":"2018-05-30T20:46:27Z","closed_at":"2018-05-30T20:46:27Z","author_association":"NONE","body":"\r\n[EPPlus 45 Issue.zip](https://github.com/JanKallman/EPPlus/files/1900777/EPPlus.45.Issue.zip)<br/>\r\nOur use of 4.1.1 for creating a spreadsheet and downloading it from an MVC controller action was to have the action return a `FileStreamResult` based on a new `MemoryStream` that was passed into the `ExcelPackage(stream)` contructor. In 4.5.1, code was added (`CloseStream()`) that disposes of that stream while 4.1.1 would preserve it if `IsExternalStream` was true (which it was set to true in that constructor if the `stream.Length == 0`.)<br/>\r\nWe found a workaround, but this might trip a lot of web people up, since this was a recommended way to do this.<br/>\r\nI've attached a fairly small solution that has 4 projects:<br/>\r\n1. WebApplicationOn41<br/>\r\n2. WebApplicationOn45<br/>\r\n3. WebApplicationOn41.Tests (with one test)<br/>\r\n4. WebApplicationOn45.Tests (with two tests, including the failing one).<br/>\r\n\r\nYou can see that a unit test in the 45 tests that tries to use the original pattern fails with the `ObjectDisposedException`.<br/>\r\nLet me know if you have questions.<br/>\r\n\r\nKarlZ\r\n"}}
{"actor":{"display_login":"JanKallman"}}