Question

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...

Was it helpful?

Solution

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top