woensdag 22 augustus 2012

Compiler warning: There was a mismatch between the processor architecture of the project being

I recently created a new SharePoint 2010 development machine. Since Visual Studio 2012 is out now I decided to use this version of Visual Studio. Everything works fine, but I receive a compiler warning:
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

Since I do not want to change the deployment target platform, the most simple solution is to suppress the error message.

Unload the project en edit the project file.
Add the following to the  (first) propertygroup element

<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

maandag 20 augustus 2012

No ULS log for web applications with a custom application pool account

When recreating a new SharePoint  I noticed no ULS for a web application. When creating a new managed account in the new web application wizard the user is not added to the "Performance Log Users" group.

When adding the used to this group, and a IIS reset, ULS log started to appear for the web application. 

dinsdag 20 april 2010

"The filename or extension is too long." when accessing MOSS CrawlRules FIX



Error when accessing the crawl rules with the SharePoint API:

Unhandled Exception: System.IO.PathTooLongException: The filename or extension is too long.
at Microsoft.Office.Server.Search.Administration.SearchApi.RunOnServer[T](CodeToRun`1 remoteCode, CodeToRun`1 localCode, Boolean useCurrentSecurityContext, Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.SearchApi.RunOnServer[T](CodeToRun`1 remoteCode, CodeToRun`1 localCode, Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.SearchApi.GetCrawlRuleList(Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.CrawlRuleCollection..ctor(Content parent)
at Microsoft.Office.Server.Search.Administration.Content.get_CrawlRules()


You can fix this error by deleting the crawl rule from the registry. Check the following registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications\90604ba8-1a0b-448d-87b6-9b5c04a69c9b\Gather\Portal_Content\Sites\*\Paths\0

and delete it.
After a reboot the crawl rules are accessible again.

Arnold thanks 4 the tip.

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.

vrijdag 3 oktober 2008

Quick TIP: Skip folders Windows desktop search

We have a lot of documents on file shares. I use windows desktop search to index the file share. This works ok, but I also was getting a lot of older versions of documents. These documents are always stored in a "archive" directory, so I cracked open the help and found:

searchterm NOT in:archive


Instead of "in:" you can also use "foldername:". Works likes a charm!

zondag 10 augustus 2008

Windows Update fails

I find Windows update on of the lesser stable parts of the Windows OS (XP pro). On a fresh installation my windows update failed with the following error (%windir%\Windowsupdate.log):

FATAL: Error: 0x80004002. wuauclt handler: failed to spawn COM server


Google to the rescue. The following fixed my problem (from a command prompt):

net stop wuauserv
regsvr32 wuapi.dll
regsvr32 wuaueng1.dll
regsvr32 wuaueng.dll
regsvr32 wucltui.dll
regsvr32 wups2.dll
regsvr32 wups.dll
regsvr32 wuweb.dll
net start wuauserv


Some extra info: http://support.microsoft.com/kb/910359.