Posts tonen met het label MOSS. Alle posts tonen
Posts tonen met het label MOSS. Alle posts tonen

maandag 22 maart 2010

MOSS - Could not load file or assembly 'cablib' or one of its dependencies. An attempt was made to load a program with an incorrect format.

When doing a upgrade of some WSP packages on a acceptation server I encountered the following error on several MOSS sites hosted in this machine:

Could not load file or assembly 'cablib' or one of its dependencies. An attempt was made to load a program with an incorrect format.

This did not happen on the dev or test environment, so what is happening here? I found out that cablib.dll was accidentally included in the WSP package. The WSP wad targeting the BIN directory of several SharePoint webapps. (We use WSP builder to create our WSP packages.) Cablib.dll is compiled for 32-bit only, when adding this dll to the bin directory of a 64 bit ASP.Net application, asp.net dies quickly. This did not cause a problem for our dev and test environment because they are 32-bit machines!

The fix was simple, clean your output directories to remove the cablib.dll from your WSP package and upgrade the WSP.

zondag 12 oktober 2008

MOSS: Label policy – how does it really work

The policies in MOSS allow you to add some document management functionality to MOSS. For example you can specify a label policy to ensure a certain label is always added to your document. But how does this work?

When saving a document to a document library, or when creating a new document from a document library the server adds the policy information to the file. Note, the file must be Word 2007 docx file (2003 doc file should also work, I will test this). The following information is added to the docx.

In the customXml folder of the unzipped word document we find the file item2.xml:

<?mso-contentType?>
<p:Policy xmlns:p="office.server.policy" id="" local="true">
<p:Name>Document</p:Name>
<p:Description>Mypolicy desc</p:Description>
<p:Statement>Label mypolicy</p:Statement>
<p:PolicyItems>
<p:PolicyItem featureId="Microsoft.Office.RecordsManagement.PolicyFeatures.PolicyLabel">
<p:Name>Labels</p:Name>
<p:Description>Generates labels that can be inserted in Microsoft Office documents to ensure that document properties or other important information are included when documents are printed. Labels can also be used to search for documents.</p:Description>
<p:CustomData>
<label>
<event type="save"/>
<event type="print"/>
<segment type="literal">MyPolicy</segment>
</label>
</p:CustomData>
</p:PolicyItem>
</p:PolicyItems>
</p:Policy>

and item5.xml



<?xml version="1.0" encoding="utf-8"?>
<p:properties xmlns:p="http://schemas.microsoft.com/office/2006/metadata/properties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<documentManagement>
<DLCPolicyLabelLock xmlns="4d54d727-23fa-4efe-b6bd-38291cb8f05e" xsi:nil="true"/>
<DLCPolicyLabelClientValue xmlns="4d54d727-23fa-4efe-b6bd-38291cb8f05e">MyPolicy</DLCPolicyLabelClientValue>
<DLCPolicyLabelValue xmlns="4d54d727-23fa-4efe-b6bd-38291cb8f05e">MyPolicy</DLCPolicyLabelValue>
</documentManagement>
</p:properties>

So the policy rules are included in the document it self.  The policy I added was myPolicy. Note the label policy does not work with the watermark functionality :(. I guess you can write a “Watermark” policy using the same strategy.