Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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!

share|improve this answer
    
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 :'-( –  Anders Rask Oct 12 '09 at 11:01
    
Haha, you learn something new all the time! –  Wictor Wilen MCA MCM MVP Oct 12 '09 at 12:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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