This really seems like a framework bug. The parameter is in the request’s params with correct name but it doesnt always bind to the action parameter. It worked for 6 months, but now this is happening in several action methods across the application.
I was able to either close VS or restart computer and that would usually fix it. Lately when i’ve run into this i couldnt get by it without turning the paramter into a string and then converting to a GUID.
Any advice on what to do with this since we have many action methods accepting nullable Guids and its a pain to have to manually convert the parameter.
I dont want a workaround for this, i want to know if anyone knows how i could debug this or what they think might be going on. It is random and inconsistent.
thanks!
Without actually having had this problem myself my initial thoughts would be that this is a problem with the actual values being passed in from the browser.
I’ve debugged a similar issue like this with nullable DateTimes and was able to get around it by writing a custom model binder and setting it up to only bind DateTime? types.
By doing this, you can inspect the values getting passed in and check them for any anomalies.
It’s pretty straight forward to do. In you global.asax:
And then create a class