Monday 30 June 2008

Code Metrics don't run with a reference to Microsoft.SharePoint.dll

I thought it might be worthwhile to run some code metrics on an event receiver that I'm writing to send emails when someone submits a request.

When running the metrics an error is returned:

Message: An error occurred while calculating code metrics for target file <YourFileName> in project <YourProjectName>. The following error was encountered while reading module 'Microsoft.SharePoint': Security attribute type does not have a default constructor: Microsoft.SharePoint.Security.SharePointPermissionAttribute, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, Publickeytoken=71e9bce111e9429c.

Solution: https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=324796

Friday 27 June 2008

UDC Creator

Whilst we are in the final stages of our phase 1 development we're already scoping phase 2 (just for fun ;) ). Part of that exercise is to assess the best way forward for some use of forms within MOSS, more specifically, whether InfoPath would be a help or hinderance.

Whilst browsing around I found the following which is link to a UDC Creator http://msdn.microsoft.com/en-us/library/bb431899.aspx guess most people will have already found it but I thought it might be useful for someone.

Thursday 19 June 2008

Cannot compare two elements within an array

I had this error message appear whilst moving between our development and staging environments. I had created a backup of the site I wanted to move and copied it over to the staging environment. Created the sites, there were four host headed sites to be created on staging to replicate our production environment. On three of the sites the stsadm -o restore command worked fine and on the fourth it would not. So after much scratching around comparing features, using utilities such as WssAnalyzeFeatures and FaultyFeatures, there was nothing obvious or indeed showing up as an error.

So to resolve the issue I used the stsadm -o export, to get a cab file and used the stsadm -o import -versions 2 and everything was fine.

Tuesday 17 June 2008

Deployment of Reusable Content pt2

It has been confirmed that the issue with versioning of automatically updateable reusable content within content deployment is a 'known issue' and will be addressed as either a hotfix or within the next service pack.

Tuesday 10 June 2008

Deployment of Reusable Content

I came across this issue the other day, which has been raised with MS who initially said they could reproduce it but now say they can't but are looking at it.

In the first instance where there is an approved version (v1.0) of the reusable content, it is added to the page and the page is deployed and the correct information is displayed.
When the reusable content is changed, so that we have a pending version (i.e. v1.1), and the deployment process is run it removes all previous versions, so that only the pending version exists, on the destination server. So if you have v2.1 pending and run the process, the destination server will have v2.1 from the source server but shows v0.1

The view on the source server is fine and so is a predeployment view (which is the site extended to Internet Zone)

Steps to reproduce the issue:

  • add some reusable content, with automatic updating, and approve it
  • add to a page (standard article page will do) approve the page so that it deploys
  • deploy to the destination server and it works as expected
  • edit the reusable content and leave it in a pending state, on the source server, this now shows as v1.0 published and v2.0 pending.
  • run the deployment
  • the content disappears from the destination server page that contained the original v1.0 – unexpected
  • on the destination server the reusable content shows v1.0 pending with the content from v2.0 pending from the source server and no previous versions.

Both servers have WSS3.0 SP1 and MOSS 2007 SP1 installed, Windows 2003 OS

Thursday 5 June 2008

Visual Studio extensions for Visual Studio 2008

Got this from the SharePoint blogs:

Announcing the VSeWSS version 1.2!

Hi everyone, Chris Johnson from the WSS PM team here.  We are really excited and pleased to announce that Version 1.2 of the Visual Studio extensions for WSS is now available for download!

This version adds Visual Studio 2008 support to the extensions.  This is something many of you have been asking for.

Download VSeWSS 1.2 right here.

Today we are releasing the English edition of the Version 1.2 extensions.  We will be releasing the German, French, Spanish, Italian, Japanese, Chinese Traditional, Chinese Simplified, and Korean language versions shortly.

We know many of you have been eagerly awaiting VS2008 support, so we hope this release will help you build fantastic SharePoint solutions with the latest Visual Studio toolset.

Note:  Version 1.2 is only for Visual Studio 2008.  If you use Visual Studio 2005, you should still use Version 1.1 (download).

Also, I'm very excited to introduce: http://www.MSSharePointDeveloper.com! If you want to learn about SharePoint development, we designed this website to be the best place for you to get started. It has links to whitepapers, virtual labs, webcasts, screencasts, quickstarts, and other useful resources.  You can also download a virtual machine that has been optimized for SharePoint development and includes all the tools you need to get started. So, go to http://www.MSSharePointDeveloper.com now! It's an easy URL to remember, so pass it along to your friends!

VSeWSS User Guide

In case you have not seen our User Guide for VSeWSS, you can download it here.  It is a great resource that explains how you can use VSeWSS in many common SharePoint development scenarios.

What's in VSeWSS?

Version 1.2 of the Visual Studio 2008 Extensions for Windows SharePoint Services contains the following tools to aid developers in building SharePoint applications:

Visual Studio 2008 Project Templates

  • Web Part
  • Team Site Definition
  • Blank Site Definition
  • List Definition
  • Empty SharePoint Project

Visual Studio 2008 Item Templates (items that can be added into an existing project)

  • Web Part
  • Custom Field
  • List Definition (with optional Event Receiver)
  • Content Type (with optional Event Receiver
  • Module
  • List Instance
  • List Event Handler
  • Template

SharePoint Solution Generator

This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.

Frequently Asked Questions and Answers

  • Q: Does VSeWSS 1.2 support Visual Studio 2008?
    A: Yes.

  • Q: Does VSeWSS 1.2 support Visual Stuido 2005?
    A: No,  you must use Version 1.1 with Visual Studio 2005.

  • Q: What additional features are in Version 1.2?
    A: For Version 1.2 we focussed on Visual Studio 2008 support only.

  • Q: Does VSeWSS support Microsoft Office SharePoint Server
    A: Yes, VSeWSS supports both Windows SharePoint Services and Office SharePoint Server.

  • Q: Does VSeWSS support Windows XP or "remote debugging"?
    A: No, VSeWSS only works against local SharePoint installations.

Thanks!

Chris Johnson
Program Manager – SharePoint