{"action":"opened","issue":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1107","repository_url":"https://api.github.com/repos/ClosedXML/ClosedXML","labels_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1107/labels{/name}","comments_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1107/comments","events_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1107/events","html_url":"https://github.com/ClosedXML/ClosedXML/issues/1107","id":392082742,"node_id":"MDU6SXNzdWUzOTIwODI3NDI=","number":1107,"title":"System.Drawing is not supported on this platform.","user":{"login":"nefcanto","id":12782347,"node_id":"MDQ6VXNlcjEyNzgyMzQ3","avatar_url":"https://avatars1.githubusercontent.com/u/12782347?v=4","gravatar_id":"","url":"https://api.github.com/users/nefcanto","html_url":"https://github.com/nefcanto","followers_url":"https://api.github.com/users/nefcanto/followers","following_url":"https://api.github.com/users/nefcanto/following{/other_user}","gists_url":"https://api.github.com/users/nefcanto/gists{/gist_id}","starred_url":"https://api.github.com/users/nefcanto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nefcanto/subscriptions","organizations_url":"https://api.github.com/users/nefcanto/orgs","repos_url":"https://api.github.com/users/nefcanto/repos","events_url":"https://api.github.com/users/nefcanto/events{/privacy}","received_events_url":"https://api.github.com/users/nefcanto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-18T10:10:45Z","updated_at":"2018-12-18T10:10:45Z","closed_at":null,"author_association":"NONE","body":"- [x] Bug\r\n\r\n**Version of ClosedXML**\r\n\r\ne.g. 0.94.0\r\n\r\n**What is the current behavior?**\r\n\r\nI can't create Excel file in my real project. The same code that works in a Console app or a simple Web App doesn't work in my app. This is the log:\r\n\r\n```\r\n\r\nSystem.Drawing is not supported on this platform.\r\n\r\n   at ClosedXML.Excel.FontBaseExtensions.GetCachedFont(IXLFontBase fontBase, Dictionary`2 fontCache)\r\n   at ClosedXML.Excel.FontBaseExtensions.GetWidth(IXLFontBase fontBase, String text, Dictionary`2 fontCache)\r\n   at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow, Double minWidth, Double maxWidth)\r\n   at ClosedXML.Excel.XLColumns.<>c__DisplayClass10_0.<AdjustToContents>b__0(XLColumn c)\r\n   at ClosedXML.Excel.XLColumns.AdjustToContents(Int32 startRow, Int32 endRow)\r\n   at ClosedXML.Excel.XLWorksheets.Add(DataTable dataTable, String sheetName)\r\n```\r\n\r\n**What is the expected behavior or new feature?**\r\n\r\nIt should work, or it should give me more data on what the underlying problem is:\r\n\r\n**Did this work in previous versions of our tool?  Which versions?**\r\n\r\nYes but I don't have access to old code and don't remember the previous version.\r\n\r\n## Reproducibility\r\n\r\n**Code to reproduce problem:**\r\n```c#\r\npublic class ExcelController : Controller\r\n    {\r\n        [HttpGet]\r\n        public IActionResult Test()\r\n        {\r\n            var table = new DataTable();\r\n            table.Columns.Add(\"Name\", typeof(string));\r\n            table.Columns.Add(\"Age\", typeof(int));\r\n            var row = table.NewRow();\r\n            row[\"Name\"] = \"First Name\";\r\n            row[\"Age\"] = 10;\r\n            table.Rows.Add(row);\r\n            var workbook = new XLWorkbook();\r\n            workbook.Worksheets.Add(table, \"Export\");\r\n            var result = new MemoryStream();\r\n            workbook.SaveAs(result);\r\n            result.Position = 0;\r\n            var bytes = result.ToArray();\r\n            var fileName = \"Export.xlsx\";\r\n            return File(new MemoryStream(bytes), \"application/octet-stream\", fileName);\r\n        }\r\n    }\r\n```\r\n\r\nThis code works just find in an isolated newly created Web App. But it throws that error in my real microservices, and I can't find out why.\r\n"}}
{"actor":{"display_login":"nefcanto"}}