Posts

Showing posts from August, 2008

The Case of the Missing Icons

In a recent attempt to add some new filetype icons to SharePoint, I stumbled across an interesting problem... duplicate entries in the icon lookup file (...\12\TEMPLATE\XML\DOCICON.xml) cause icons to disappear, with the alt text "Item Icon" in their place. In my case, I added a Photoshop (.psd) icon for some of our designers. But, just like this guy , I quickly realized that SharePoint already has one. A duplicate entry will break icons in lots of places (search, for example), so edit with care.

Unicode Reference

When using SharePoint sometimes you run into a URL with lots of unicode character markup. Here's a good reference so you can figure out what the h%65ck it all means.

List Types and Base Types

Here's a good reference that I've been using for the all the List Types and BaseTypes:

Bulk MySite Creation

Image
Because SharePoint will display active links to MySites that might not exist, I was asked to "pre-create" all of the MySites before an upcoming rollout to prevent any confusion from "broken" links. I found a tool at codeplex called TIN that seemed to do what I needed, but it was a little clunky so I rewrote it. The new version is incredibly simple, but it might save somone some time so I thought I'd share. Basic features include: Bulk creation of MySites for entries in the ProfileManager Bulk deletion of MySites for entries in the ProfileManager List profiles from the ProfileManager and whether they have a MySite Robust logging and error handling Save-to-File for log results Multiple threads for long-running operations and smoother screen updates The source code isn't so beautiful, but here it is . Feel free to make any changes you like, and let us know if it worked for you. Also, if you do make changes and want to share, just send it in and we'l...

"This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application." in STSDEV

I recently created a Web Part based on the STSDEV Web Part project and found it was very simple to use. I had another Web Part to create but this time I decided to go with the more generic 'Empty Solution' project just to ensure I wasn't getting lazy with all the stuff STSDEV does for me. The project built, and installed properly into the solution store, but doing a 'DebugDeploy' failed with an error. I compared the two projects and they seemed to be configured identically. However upon further inspection, I found that the 'DebugDeploy' section of the Web Part Project (STS DEV generated) is different than the 'DebugDeploy' section of the empty solution. changing this line: <Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment" /> to: <Exec Command="$(STSADM) -o deploysolution -name $(PackageName) -immediate -allowgacdeployment -allcontenturls" /> solved the problem. NOTE:...

Activating SharePoint Publishing Infrastructure Results in 'Access Denied'

I was getting a 'Access Denied' error when trying to activate the SharePoint Publishing Infrastructure feature. I found two solutions. The first involved changing the Application Pool that Central Admin ran under. The second, found here , simply involves running an STSADM command from the command line. In a production system, I'd say that the stsadm way to go (it's also faster).

SharePoint Slow?

Joel Oleson's blog has a great post on dealing with the slowness on first page request we've all dealt with.

Web Part Styles

There are many examples of how to create a web part. However the best way to style web parts is not necessarily well documented, so I thought I'd offer up my approach and see what the community thinks. Basically I create my web part as a feature in a solution. Then, if my web part generates any code that requires styling I add a .css file to my feature directory. Next I provision the stylesheet of my web part to a folder within my site's "Style Library". Finally I add the code into my web part to add the stylesheet ("<link>") link to the header of the page that my web part has been dropped on. Most of the stuff is straightforward but here's how to provision a style sheet to the style library: Add a "provisioning.xml" file to your feature and reference it in the ElementManifest section of Feature.xml in "provisioning.xml" enter the following: <?xml version="1.0" encoding="utf-8" ?> <Elements xml...

WebPart Error: [ArgumentException: The serialized data is invalid.]

You may run into this problem. In my case I had a legitimate serialization error, but when I took out the offending code I was still getting the same error. I found the solution is to close/readd the webpart to eliminate the error.