0

I am adding a web part directly into a zonetemplate in a page layout.

When i insert a custom web part that has a web part property of type uint, i get an YSOD server error:

Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The "Hits" property of has type "System.Uint32", which is not CLS-compliant.

What would be the easiest way to mitigate this error?

I could change the data type to int, but that would mean changing alot of code and web part xml files, and changing error handling and test cases accordingly. Since the project is huge, a workaround in the page layout would be preferable...

1 Answer 1

1

I replicated the error, since I also have used UInt32's. I've never added them using SPD to a zone template, but instead used the web interface - which works fine though.

If you check the error stack and then use Reflector it makes a check (PropertyMapper.IsTypeClsCompliant) that the property is not of the UInt32 (and some others), so my guess is that there are no workaround.

Workaround is to use a CLS compliant type; for UInt32 an Int64 would work best and will probably not affect your solution that much.

Good luck mate!

2
  • Dont acuse me of using SPD Wictor :-p Its going in the PL directly ofcourse :-) Other solution was to do it with a feature but that gives you the problem when people reactivates features and web part is already added. Sigh that uint is used everywhere, including my DAL against FAST ESP so its gonna take some refactoring to get it converted to a signed integer :'-( Oct 12, 2009 at 11:01
  • Haha, you learn something new all the time! Oct 12, 2009 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.