{"issue":{"created_at":"2011-03-15T18:05:28Z","state":"open","updated_at":"2011-12-10T05:28:01Z","user":{"gravatar_id":"bae87fae2d280e62beff9d0cf3041b07","id":85384,"url":"https://api.github.com/users/PrintsCharming","avatar_url":"https://secure.gravatar.com/avatar/bae87fae2d280e62beff9d0cf3041b07?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"PrintsCharming"},"comments":35,"body":"Win 7 x64 SP1, VS 2010 SP1.\r\n\r\nLooks like all the project references are resolving right. Weird\r\n\r\n\r\nSystem.Security.VerificationException was unhandled by user code\r\n  Message=Operation could destabilize the runtime.\r\n  Source=Spark\r\n  StackTrace:\r\n       at Spark.FileSystem.FileSystemViewFolder.ListViews(String path)\r\n       at Spark.Parser.ViewLoader.<FindAllPartialFiles>d__9.MoveNext()\r\n       at System.Linq.Enumerable.<DistinctIterator>d__81`1.MoveNext()\r\n       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n       at Spark.Parser.ViewLoader.FindPartialFiles(String viewPath)\r\n       at Spark.Parser.ViewLoader.LoadInternal(String viewPath)\r\n       at Spark.Parser.ViewLoader.Load(String viewPath)\r\n       at Spark.SparkViewEngine.LoadTemplates(ViewLoader loader, IEnumerable`1 templates, ICollection`1 chunksLoaded, ICollection`1 templatesLoaded)\r\n       at Spark.SparkViewEngine.CreateEntryInternal(SparkViewDescriptor descriptor, Boolean compile)\r\n       at Spark.SparkViewEngine.CreateEntry(SparkViewDescriptor descriptor)\r\n       at Nancy.ViewEngines.Spark.SparkViewEngine.FindViewInternal(ActionContext actionContext, String viewName, String masterName, Boolean findDefaultMaster, Boolean useCache) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.ViewEngines.Spark\\SparkViewEngine.cs:line 170\r\n       at Nancy.ViewEngines.Spark.SparkViewEngine.FindView(ActionContext actionContext, String viewName, String masterName) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.ViewEngines.Spark\\SparkViewEngine.cs:line 115\r\n       at Nancy.ViewEngines.Spark.SparkViewEngine.RenderView[TModel](String path, TModel model) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.ViewEngines.Spark\\SparkViewEngine.cs:line 395\r\n       at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)\r\n       at Nancy.ViewEngines.Spark.SparkViewEngine.<>c__DisplayClassf.<RenderView>b__e(Stream stream) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.ViewEngines.Spark\\SparkViewEngine.cs:line 421\r\n       at Nancy.Hosting.Aspnet.NancyHandler.SetNancyResponseToHttpResponse(HttpContextBase context, Response response) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.Hosting.Aspnet\\NancyHandler.cs:line 42\r\n       at Nancy.Hosting.Aspnet.NancyHandler.ProcessRequest(HttpContextBase context) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.Hosting.Aspnet\\NancyHandler.cs:line 21\r\n       at Nancy.Hosting.Aspnet.NancyHttpRequestHandler.ProcessRequest(HttpContext context) in C:\\Projecten\\Nancy\\Nancy\\src\\Nancy.Hosting.Aspnet\\NancyHttpRequestHandler.cs:line 76\r\n       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)\r\n  InnerException: \r\n","assignee":null,"id":676208,"labels":[{"name":"Care.ToJans","color":"e8e8e8","url":"https://api.github.com/repos/ToJans/NerdBeers/labels/Care.ToJans"},{"name":"Stat.Started","color":"008f15","url":"https://api.github.com/repos/ToJans/NerdBeers/labels/Stat.Started"},{"name":"Type.Bug","color":"ff0000","url":"https://api.github.com/repos/ToJans/NerdBeers/labels/Type.Bug"}],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":5,"title":"Unzipped, opened F5...error \"Operation could destabilze the runtime\"","html_url":"https://github.com/ToJans/NerdBeers/issues/5","closed_at":null,"url":"https://api.github.com/repos/ToJans/NerdBeers/issues/5","milestone":null},"action":"created","comment":{"created_at":"2011-12-10T05:28:01Z","updated_at":"2011-12-10T05:28:01Z","user":{"gravatar_id":"cf7e82abee3b5c867cc48cd1d8babe09","id":150951,"url":"https://api.github.com/users/emiaj","avatar_url":"https://secure.gravatar.com/avatar/cf7e82abee3b5c867cc48cd1d8babe09?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"emiaj"},"body":"@PrintsCharming, do you still get this exception?\r\nI have been living with it for a long time already.\r\nMy pc is Win7 64bits, and I get that exception only when running the app from visual studio (F5).\r\nI remember getting this exception when trying to debug some fubumvc sample project that used spark as well, so, I suspect is not related to NerdBeers but to Spark itself.\r\nToday I spiked another demo project of my own using spark and fubumvc and this issue is hitting me back again :(\r\nThe stack trace is:\r\n\r\nLambda expression at: FubuMVC.Core.FubuApplication+<>c__DisplayClasse.<Bootstrap>b__9(),  line 0\r\nSystem.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.VerificationException: Operation could destabilize the runtime.\r\n  at Spark.FileSystem.FileSystemViewFolder.ListViews(String path)\r\n\r\nI have even cloned the spark repository, and compiled the spark project locally, but no luck, I still get that exception.\r\n\r\nI couldn't explain why is happening, and I consider myself good at hunting bugs....\r\n\r\nI remember I did something that fixed the problem, but couldn't explain why :(\r\n\r\nHere it is....\r\n\r\nClone the spark repository, and change this line:\r\n\r\nhttps://github.com/RobertTheGrey/spark/blob/master/src/Spark/FileSystem/FileSystemViewFolder.cs#L48\r\n\r\nInto:\r\nreturn new List<string>();\r\n\r\nFor some reason (¿the compiler freaks out because output type is List<string> and the method is returning string[0]?) that little harmless change fixes the problem.\r\n\r\nIt would be awesome if you could give it a try and see if that works.\r\n\r\nOnce again, I thought I was alone on this one at that nobody else could help me, that's why I never reported the issue publicly, seems I am not alone after all :)\r\n\r\nThis thread in StackOverlflow seem to throw some lights at the problem:\r\nhttp://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime\r\n\r\nKind Regards,\r\nJaime.\r\n","id":3089370,"url":"https://api.github.com/repos/ToJans/NerdBeers/issues/comments/3089370"}}