{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/313","repository_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script","labels_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/313/comments","events_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/313/events","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/issues/313","id":151854172,"number":313,"title":"InvalidCastException on startup. Need better error message.","user":{"login":"StephaneBischoff","id":9750058,"avatar_url":"https://avatars.githubusercontent.com/u/9750058?v=3","gravatar_id":"","url":"https://api.github.com/users/StephaneBischoff","html_url":"https://github.com/StephaneBischoff","followers_url":"https://api.github.com/users/StephaneBischoff/followers","following_url":"https://api.github.com/users/StephaneBischoff/following{/other_user}","gists_url":"https://api.github.com/users/StephaneBischoff/gists{/gist_id}","starred_url":"https://api.github.com/users/StephaneBischoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephaneBischoff/subscriptions","organizations_url":"https://api.github.com/users/StephaneBischoff/orgs","repos_url":"https://api.github.com/users/StephaneBischoff/repos","events_url":"https://api.github.com/users/StephaneBischoff/events{/privacy}","received_events_url":"https://api.github.com/users/StephaneBischoff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-29T12:24:30Z","updated_at":"2016-05-02T15:31:22Z","closed_at":null,"body":"Hi,\r\n\r\nUsing latest alpha packages.  (WebJobs.Script 1.0.0-alpha1-10027)\r\n\r\nGetting exception on startup. \r\nAn unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.Azure.WebJobs.Script.dll\r\nAdditional information: **Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type 'Newtonsoft.Json.Linq.JObject'.**\r\n   at Microsoft.Azure.WebJobs.Script.NodeFunctionDescriptorProvider.TryCreate(FunctionFolderInfo functionFolderInfo, FunctionDescriptor& functionDescriptor)\r\n   at Microsoft.Azure.WebJobs.Script.ScriptHost.ReadFunctions(List`1 functionFolderInfos, IEnumerable`1 descriptorProviders)\r\n   at Microsoft.Azure.WebJobs.Script.ScriptHost.ReadFunctions(ScriptHostConfiguration config, IEnumerable`1 descriptionProviders)\r\n   at Microsoft.Azure.WebJobs.Script.ScriptHost.Initialize()\r\n   at Microsoft.Azure.WebJobs.Script.ScriptHost.Create(ScriptHostConfiguration scriptConfig)\r\n   at WebJobScriptRunner.Program.Main()\r\n\r\n```\r\npublic class Program\r\n    {\r\n        static void Main()\r\n        {\r\n            ScriptHostConfiguration config = new ScriptHostConfiguration()\r\n            {\r\n                // path to root function script directory\r\n                RootPath = Environment.CurrentDirectory\r\n            };\r\n\r\n            var host = ScriptHost.Create(config); <--- EXCEPTION THROWN HERE\r\n            host.RunAndBlock();\r\n        }\r\n    }\r\n```\r\n\r\nI have no clue what I am doing wrong in my first Azure function project. Here is my host.jon and function.json.\r\n\r\n`\r\n{\r\n  \"id\": \"5e8ef5be0c6849819ef8b70ce0cb0d1e\"\r\n}\r\n`\r\n\r\n`\r\n{\r\n  \"bindings\": [\r\n    {\r\n      \"direction\": \"in\",\r\n      \"queueName\": \"script-jobs\",\r\n      \"type\": \"queueTrigger\"\r\n    }\r\n  ]\r\n}\r\n`\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/comments/216268618","html_url":"https://github.com/Azure/azure-webjobs-sdk-script/issues/313#issuecomment-216268618","issue_url":"https://api.github.com/repos/Azure/azure-webjobs-sdk-script/issues/313","id":216268618,"user":{"login":"mathewc","id":1056548,"avatar_url":"https://avatars.githubusercontent.com/u/1056548?v=3","gravatar_id":"","url":"https://api.github.com/users/mathewc","html_url":"https://github.com/mathewc","followers_url":"https://api.github.com/users/mathewc/followers","following_url":"https://api.github.com/users/mathewc/following{/other_user}","gists_url":"https://api.github.com/users/mathewc/gists{/gist_id}","starred_url":"https://api.github.com/users/mathewc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathewc/subscriptions","organizations_url":"https://api.github.com/users/mathewc/orgs","repos_url":"https://api.github.com/users/mathewc/repos","events_url":"https://api.github.com/users/mathewc/events{/privacy}","received_events_url":"https://api.github.com/users/mathewc/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T15:31:22Z","updated_at":"2016-05-02T15:31:22Z","body":"ScriptHostManager is publically exported by Microsoft.Azure.WebJobs.Script (see [here](https://github.com/Azure/azure-webjobs-sdk-script/blob/master/src/WebJobs.Script/Host/ScriptHostManager.cs)).\r\n\r\nMy plan is to go through the \"run in console app\" steps myself and document them in the wiki."}}