Wednesday 24 June 2009

Sharepoint Visual Studio Extensions Gotchas Day 1

Before I start I am going to caveat everything in this blog by saying I am only just starting out with Sharepoint and so am open to being challenged on anything within these articles.

I am developing Sharepoint and am using the Visual Studio Extensions and when I start a new Technology I like to get the structure of the project working within Visual Studio. I see this as a foundation for future development of the project. Now even with my lack of knowledge of all things Sharepoint the first thing that struck me was that it was a temperamental beast.

Firstly I am trying to implement Content types via the WSS API and specifically the SPFeatureReceiver class. Now the first thing that struck me was that due to development being iterative and requirements constantly shifting I would need to be able to deploy my content types on an individual basis what is the point of re-deploying all your content types just to implement a small change in one of them.

With this in mind I though I know within my solution I will have each individual content type in its own project that way I can deploy on a project by project basis. I will also have common code in its own project as a standard helper class. Good Idea but totally wrong.
I found out that even in helper projects you must specify the deployment site in the projects debug property url. Even when I put this in which seemed overkill and right clicked the project I wanted to deploy even though the context menu inferred I was only deploying the project I had right clicked on I was in fact deploying the whole solution and not just the project that I wanted..... (Again this may be newbie ignorance here so feel free to show me the errors of my ways). So I am now back at square one looking at the best ways to provision a site via the API and Visual Studio Extensions.

Oh also here is a tip for newbies always put code in the uninstall method to remove the feature item you have installed and better still put some guard code in the activating method to check for the existence of that item and remove it before re-installing it. Many hours of debugging and head scratching wasted over that one.

I fear this is going to be a journey.... sometimes not pleasant but always an interesting one..... I struggle on !!!!!!

No comments:

Post a Comment