问题
On a web site I published (pre-compiled) last night, I get the following error. Before pre-compiling it, I was getting a compiler error that a User Control was not found. After compiling on another machine, and running, I get the following Parser error:
"Cannot create an object of type 'System.Type' from its srting representation 'System.Int32' for the 'DataType' property"
was the, now runtime, parser error I got. The offending tag is telerik:RadNumericTextBox .... DataType="System.Int32"...
I emphasise again that this error only occurs on XP SP2, not on Vista and Win7. I'm off to do some Googling and issue logging at Telerik.
回答1:
I had this problem in one of my projects and it disappeared when I moved to the latest release Q1 2009 SP1.
Dick
回答2:
The base of this problem isn't just Telerik, but ASP.NET not being able to interpret the string representation. I just tried this on a small test project, with no Telerik, and I get the same error.
This is not to say the haven't fixed it, but I would be impressed to see how they did. It is easily done with two properties, one that takes a string and gets a type from it, and sets the actual type property, but that gets messy.
回答3:
My guess would be that there is a GetType
-type-of-resolution somewhere inside Telerik that is failing. It may be worth trying adding the assembly name to the string if this happens
e.g.: "System.Int32, mscorlib"
...
来源:https://stackoverflow.com/questions/729243/error-creating-system-type-from-string-system-int32