{"action":"created","issue":{"url":"https://api.github.com/repos/Antaris/RazorEngine/issues/268","labels_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/268/labels{/name}","comments_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/268/comments","events_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/268/events","html_url":"https://github.com/Antaris/RazorEngine/issues/268","id":67582529,"number":268,"title":"RazorEngine conflicts with Glimpse?","user":{"login":"impworks","id":604496,"avatar_url":"https://avatars.githubusercontent.com/u/604496?v=3","gravatar_id":"","url":"https://api.github.com/users/impworks","html_url":"https://github.com/impworks","followers_url":"https://api.github.com/users/impworks/followers","following_url":"https://api.github.com/users/impworks/following{/other_user}","gists_url":"https://api.github.com/users/impworks/gists{/gist_id}","starred_url":"https://api.github.com/users/impworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/impworks/subscriptions","organizations_url":"https://api.github.com/users/impworks/orgs","repos_url":"https://api.github.com/users/impworks/repos","events_url":"https://api.github.com/users/impworks/events{/privacy}","received_events_url":"https://api.github.com/users/impworks/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-10T12:22:13Z","updated_at":"2015-04-10T17:16:29Z","closed_at":"2015-04-10T13:07:11Z","body":"In my ASP.NET MVC app I have an async controller message that must send an email. The email is processed via RazorEngine. Looks pretty straightforward, but Glimpse seems to conflict with it for some reason.\r\n\r\nMy code:\r\n```\r\npublic virtual async Task<ActionResult> SendEmail()\r\n{\r\n    var path = \"~/Views/Email/MyTemplate.cshtml\";\r\n    using (var reader = new StreamReader(HostingEnvironment.MapPath(path)))\r\n    {\r\n  \t    // fails here:\r\n        var result = Engine.Razor.RunCompile(reader.ReadToEnd(), path, null, new { Id = 1 });\r\n    }\r\n    // ...\r\n}\r\n```\r\n\r\nThe exception message:\r\n```\r\nSome environments conflict with current Glimpse async support.\r\nPlease set Glimpse:DisableAsyncSupport = true in Web.config, or see https://github.com/Glimpse/Glimpse/issues/632 for more details.\r\n```\r\n\r\nThe exception stacktrace:\r\n```\r\nat Glimpse.AspNet.AspNetFrameworkProvider.AntiSerializationWrapper`1.GetObjectData(SerializationInfo info, StreamingContext context)\r\nat System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object serObj, String& typeName, String& assemName, String[]& fieldNames, Object[]& fieldValues)\r\n\r\nat System.AppDomain.InternalCreateInstanceFromWithNoSecurity(String assemblyName, String typeName)\r\nat RazorEngine.Compilation.CrossAppDomainCleanUp..ctor(AppDomain toWatch, IPrinter printer)\r\nat RazorEngine.Compilation.CrossAppDomainCleanUp.CreateInitial()\r\nat System.Lazy`1.CreateValue()\r\nat System.Lazy`1.LazyInitValue()\r\nat RazorEngine.Compilation.CrossAppDomainCleanUp.RegisterCleanup(String item, Boolean throwOnDefault)\r\nat RazorEngine.Templating.DefaultCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey)\r\nat RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)\r\nat RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)\r\nat RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)\r\nat RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass4.<RunCompile>b__3(TextWriter writer)\r\nat RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)\r\n```\r\n\r\nAny idea what is wrong? Why is Glimpse implicitly triggered and is there any way RazorEngine can be configured to avoid it?"},"comment":{"url":"https://api.github.com/repos/Antaris/RazorEngine/issues/comments/91625809","html_url":"https://github.com/Antaris/RazorEngine/issues/268#issuecomment-91625809","issue_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/268","id":91625809,"user":{"login":"matthid","id":1866463,"avatar_url":"https://avatars.githubusercontent.com/u/1866463?v=3","gravatar_id":"","url":"https://api.github.com/users/matthid","html_url":"https://github.com/matthid","followers_url":"https://api.github.com/users/matthid/followers","following_url":"https://api.github.com/users/matthid/following{/other_user}","gists_url":"https://api.github.com/users/matthid/gists{/gist_id}","starred_url":"https://api.github.com/users/matthid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthid/subscriptions","organizations_url":"https://api.github.com/users/matthid/orgs","repos_url":"https://api.github.com/users/matthid/repos","events_url":"https://api.github.com/users/matthid/events{/privacy}","received_events_url":"https://api.github.com/users/matthid/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T17:16:29Z","updated_at":"2015-04-10T17:16:29Z","body":"Actually, you can try if https://www.nuget.org/packages/RazorEngine/3.6.5-beta1 fixes the problem as well."}}