Web Part Versioning

Tags: .NET, SharePoint

If you have a web-part on your development machine that occasionaly decides to die - give you Not Marked As Safe errors even though it is, and requires removal and readding for it to work (with no other steps necessary), you may have a version mismatch.

Even if you register your web-part in the SafeControl section without any version information and without strong-naming it, somewhere along the way the version number DOES matter.
Projects created from the Web Part Library template have the version number in the AssemblyInfo.cs file automatically set to a static 1.0.0.0, but if you have an assembly that was made using the Class Library template, it will be auto-set to 1.0.*, causing builds to generate different, psuedo-random build numbers, causing your Web Part to break.

1 Comment

  • Gidi Morris said

    Hi Avner,
    Any idea what in the SPS requires the versioning?

    I mean, will this problem always arise at one point or a nother of the WP's life? or is it true to a specific situation depending on what the WP is used for in the Portal?

Comments have been disabled for this content.