question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to cast Object of type(...) to ICommandHandler

See original GitHub issue

Following your recent Part 1 video on using FunctionMonkey and once I have a simple structure created to verify the plumbing works, I get the following error:

[3/17/19 2:00:58 AM] AzureFromTheTrenches.Commanding: Error occurred during command execution. Anonymously Hosted DynamicMethods Assembly: Unable to cast object of type 'ThreeWill.Functions.Application.Handlers.HelloWorldCommandHandler' to type 'AzureFromTheTrenches.Commanding.Abstractions.ICommandHandler`2[ThreeWill.Functions.Commands.HelloWorldCommand,System.String]'.``` 

Using the v1.0.0 versions of FunctionMonkey an FunctionMonkey.Compiler.  
Using v9.0.1 of the Commanding Abstractions.  
Azure Functions Core Tools 2.4.401
Function Runtime Version: 2.0.12309.0

Have you seen this before?  Both macOS w/ VS Code and VS 2017 enterprise get the same result.  Debugging does not seem to get past some of the Function framework prices, or maybe I am missing a way to debug into the actual issue.  

I'll keep digging, but thought I would ask if this might be something simple.  

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JamesRandallcommented, Mar 17, 2019

No problem at all.

I moved Function Monkey to v1.0.0 since I recorded the first 2 videos and there were a couple of breaking changes - in case you run into any issues there is a very short doc here that describes them and how to resolve them:

https://functionmonkey.azurefromthetrenches.com/guides/upgradingTo1.0.html

I also cover them in part 3 which I should be publishing later today.

0reactions
pkskellycommented, Mar 17, 2019

Thanks James, I knew it was likely something simple! Sorry for the bother but very much appreciate the response and patience! Works perfectly!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command binding Unable to cast object of type 'System. ...
You don't bind a command to the Click property. The Click property is for adding a traditional event handler to the Click event....
Read more >
Generic ICommand error - Microsoft Q&A
This object you can cast to IEnumerable of objects. If you want cast to IEnumarable of your Item type you must cast every...
Read more >
"CommandParameter: Unable to cast object of type ' ...
note that when I use "InvalidRowExceptionEventArgs" I have exception "unable to cast to GridRowValidationEventArgs" when invalid is fired;
Read more >
unable to cast com object error
I am using vb.net and InDesign 2018. The error I get is Unable to cast COM object of type 'System.__ComObject' to interface type...
Read more >
[BUG] Unable to cast object when initialising interface #1125
Net Framework to .Net 5, it gives me this error. Unable to cast object of type 'UIHelpersRestClientRefitBugIWoofClient' to type 'UI.Helpers.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found