{"action":"created","issue":{"url":"https://api.github.com/repos/jet/FsBlog/issues/4","repository_url":"https://api.github.com/repos/jet/FsBlog","labels_url":"https://api.github.com/repos/jet/FsBlog/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/jet/FsBlog/issues/4/comments","events_url":"https://api.github.com/repos/jet/FsBlog/issues/4/events","html_url":"https://github.com/jet/FsBlog/issues/4","id":135197338,"number":4,"title":"Adding a .ToString to a date in one file (but not another) causes FSharp.Core mismatch errors ","user":{"login":"rachelreese","id":1075744,"avatar_url":"https://avatars.githubusercontent.com/u/1075744?v=3","gravatar_id":"","url":"https://api.github.com/users/rachelreese","html_url":"https://github.com/rachelreese","followers_url":"https://api.github.com/users/rachelreese/followers","following_url":"https://api.github.com/users/rachelreese/following{/other_user}","gists_url":"https://api.github.com/users/rachelreese/gists{/gist_id}","starred_url":"https://api.github.com/users/rachelreese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rachelreese/subscriptions","organizations_url":"https://api.github.com/users/rachelreese/orgs","repos_url":"https://api.github.com/users/rachelreese/repos","events_url":"https://api.github.com/users/rachelreese/events{/privacy}","received_events_url":"https://api.github.com/users/rachelreese/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-21T11:58:49Z","updated_at":"2016-02-21T17:41:54Z","closed_at":null,"body":"For awhile, it's been bugging me that on the main page of the blog, the tagline pretty-prints the date, e.g.: \r\n\r\n> \"Gene Belitski    |     Jan 30, 2016   |   f#, interview   |    We're hiring: Director, Engineering (Dublin)!\" \r\n[(page layout file](https://github.com/jet/FsBlog/tree/master/Code/content/layouts/page.cshtml\"))\r\n\r\nbut when you click in to the post, it reads: \r\n\r\n> \"Gene Belitski    |     2016-01-30T03:49:06   |   F#, interview\" \r\n([post layout file](https://github.com/jet/FsBlog/tree/master/Code/content/layouts/post.cshtml))\r\n\r\nI tried copy-pasting the entire `@tagline` section of code, but kept getting errors. Tracked it down. Specifically, when I try to update this line, in the post layout file: \r\n\r\n`@AddedDate`\r\nto \r\n`@AddedDate.ToString(\"MMM d, yyyy\")`\r\n\r\nI receive the following error. The weird thing is, it obviously works fine in the page layout file, so what the heck? \r\n\r\n```\r\nSomething went wrong: RazorEngine.Templating.TemplateCompilationException: Unable to compile template. Assuming assembly \r\nreference 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches 'FSharp.Core, Version=\r\n4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need to supply runtime policy                        \r\n                                                                                                                         \r\nOther compilation errors may have occurred. Check the Errors property for more information.                              \r\n   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context) in c:\\_git\\RazorEngine\\src\\Core\\\r\nRazorEngine.Core\\Compilation\\DirectCompilerServiceBase.cs:line 106                                                       \r\n   at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType) in c:\\_git\\RazorEng\r\nine\\src\\Core\\RazorEngine.Core\\Templating\\TemplateService.cs:line 256                                                     \r\n   at RazorEngine.Templating.TemplateService.GetTemplate[T](String razorTemplate, Object model, String cacheName) in c:\\_\r\ngit\\RazorEngine\\src\\Core\\RazorEngine.Core\\Templating\\TemplateService.cs:line 374                                         \r\n   at RazorEngine.Templating.TemplateService.Resolve(String cacheName, Object model) in c:\\_git\\RazorEngine\\src\\Core\\Razo\r\nrEngine.Core\\Templating\\TemplateService.cs:line 570                                                                      \r\n   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context) in c:\\_git\\RazorEn\r\ngine\\src\\Core\\RazorEngine.Core\\Templating\\TemplateBase.cs:line 0                                                         \r\n   at FsBlogLib.Razor.ProcessFile(String source) in C:\\Users\\jetadmin\\GitHub\\Jet Code\\FsBlog\\Code\\tools\\FsBlogLib\\Razor.f\r\ns:line 54\r\n```\r\n\r\nHalp? @tpetricek, @robertpi (since you've contributed to FsBlog recently, :) ) \r\n\r\nNot sure who to tag on this one, or where even to start tracking it down from here, so feel free to tag away. :-) Thanks! "},"comment":{"url":"https://api.github.com/repos/jet/FsBlog/issues/comments/186869474","html_url":"https://github.com/jet/FsBlog/issues/4#issuecomment-186869474","issue_url":"https://api.github.com/repos/jet/FsBlog/issues/4","id":186869474,"user":{"login":"robertpi","id":51381,"avatar_url":"https://avatars.githubusercontent.com/u/51381?v=3","gravatar_id":"","url":"https://api.github.com/users/robertpi","html_url":"https://github.com/robertpi","followers_url":"https://api.github.com/users/robertpi/followers","following_url":"https://api.github.com/users/robertpi/following{/other_user}","gists_url":"https://api.github.com/users/robertpi/gists{/gist_id}","starred_url":"https://api.github.com/users/robertpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertpi/subscriptions","organizations_url":"https://api.github.com/users/robertpi/orgs","repos_url":"https://api.github.com/users/robertpi/repos","events_url":"https://api.github.com/users/robertpi/events{/privacy}","received_events_url":"https://api.github.com/users/robertpi/received_events","type":"User","site_admin":false},"created_at":"2016-02-21T17:41:54Z","updated_at":"2016-02-21T17:41:54Z","body":"These razor files are a bit black magic, unfortunately. At a guess\n\"@AddedDate\" is typed as object, so it can't find the format\noverload when you try and call the ToString method? I notice the way\nthe that works uses a help function to format the string, could you\ncopy past that?\n\nA cleaner way might be to get the model that provides @AddedDate to do\nthe formating before it's passed to razor, but I've know idea which\nmodel provides @AddedDate.\n\nCheers, Rob\n\n\nOn Sun, Feb 21, 2016, at 12:58 PM, Rachel Reese wrote:\n> For awhile, it's been bugging me that on the main page of the blog,\n> the tagline pretty-prints the date, e.g.:\n\n\n>> \"Gene Belitski    |     Jan 30, 2016   |   f#, interview   |    We're\n>> hiring: Director, Engineering (Dublin)!\" (page layout file[1])\n\n\n> but when you click in to the post, it reads:\n\n\n>> \"Gene Belitski    |     2016-01-30T03:49:06   |   F#, interview\"\n>>\n(post layout file[2])\n\n\n> I tried copy-pasting the entire @tagline section of code, but kept\n> getting errors. Tracked it down. Specifically, when I try to update\n> this line, in the post layout file:\n\n\n> @AddedDate\n>\nto\n> @AddedDate.ToString(\"MMM d, yyyy\")\n\n\n> I receive the following error. The weird thing is, it obviously works\n> fine in the page layout file, so what the heck?\n\n\n> `Something went wrong:\n> RazorEngine.Templating.TemplateCompilationException: Unable to compile\n> template. Assuming assembly\n>\nreference 'FSharp.Core, Version=4.3.0.0, Culture=neutral,\nPublicKeyToken=b03f5f7f11d50a3a' matches 'FSharp.Core, Version=\n>\n4.3.1., Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need\n      to supply runtime policy\n\n\n> Other compilation errors may have occurred. Check the Errors property\n> for more information.\n>\n>\n   at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(Typ-\n   eContext context) in c:_git\\RazorEngine\\src\\Core\\\n>\nRazorEngine.Core\\Compilation\\DirectCompilerServiceBase.cs:line 106\n>\n>\n   at RazorEngine.Templating.TemplateService.CreateTemplateType(String\n   razorTemplate, Type modelType) in c:_git\\RazorEng\n>\nine\\src\\Core\\RazorEngine.Core\\Templating\\TemplateService.cs:line 256\n>\n>\n   at RazorEngine.Templating.TemplateService.GetTemplateT in c:_\n>\ngit\\RazorEngine\\src\\Core\\RazorEngine.Core\\Templating\\TemplateService.c-\ns:line 374\n>\n>\n   at RazorEngine.Templating.TemplateService.Resolve(String cacheName,\n   Object model) in c:_git\\RazorEngine\\src\\Core\\Razo\n>\nrEngine.Core\\Templating\\TemplateService.cs:line 570\n>\n>\n   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITempl-\n   ate.Run(ExecuteContext context) in c:_git\\RazorEn\n>\ngine\\src\\Core\\RazorEngine.Core\\Templating\\TemplateBase.cs:line 0\n>\n>\n   at FsBlogLib.Razor.ProcessFile(String source) in\n   C:\\Users\\jetadmin\\GitHub\\Jet Code\\FsBlog\\Code\\tools\\FsBlogLib\\Razor.f\n>\ns:line 54`\n\n\n> Halp? @tpetricek[3], @robertpi[4] (since you've contributed to FsBlog\n> recently, :) )\n\n\n> Not sure who to tag on this one, or where even to start tracking it\n> down from here, so feel free to tag away. :-) Thanks!\n\n\n> — Reply to this email directly or view it on GitHub[5].\n\n\n>\n\n\n\nLinks:\n\n  1. https://github.com/jet/FsBlog/tree/master/Code/content/layouts/page.cshtml%22\n  2. https://github.com/jet/FsBlog/tree/master/Code/content/layouts/post.cshtml\n  3. https://github.com/tpetricek\n  4. https://github.com/robertpi\n  5. https://github.com/jet/FsBlog/issues/4\n"}}