Subsonic 3: Invalid cast from 'System.Byte'

2019-08-21 12:17发布

问题:

I'm trying to use Subsonic 3.0 but with every query I try it gives me this error:

"Invalid cast from 'System.Byte' to 'System.Byte[]'."

I've tried using linq and activerecord on several different tables and always having this problem.

Just to make sure, here is a code snipped that throws the error: LiteralContent.Text = DB.Teksten.SingleOrDefault(t => t.ID == Convert.ToInt32(TextID)).Tekst;

Also try to debug into the error but couldn't find the exact source of the error while stepping through it.

回答1:

Just found the solution. A user already reported this bug 33 weeks ago and posted a fix at: http://blog.wekeroad.com/subsonic/subsonic-3-0-repository-template-update/

Has to do with generation of tinyint datatype.



回答2:

I fixed this error today with the release of 3.0.0.1 (I hope): http://blog.wekeroad.com/subsonic/subsonic-3-0-0-1-released/



回答3:

I just downloaded 3.0.0.1 and it's not fixed also check this one

link text

I have included the fix