Andrew Connell [MVP MOSS]
1531 Posts |  42 Articles |  4706 Comments
.NET  |  MCMS  |  SharePoint  |  Office System
SharePoint Quick Links
Article Categories
Archives
Post Categories


Add to Technorati Favorites

I ran into this doing a few code samples for SharePoint 2010 using the Visual Studio 2010 Beta 2 SharePoint tools. Passing it along as it threw me for a loop when I first saw it.

First, in case you aren’t aware, the SharePoint “things” you add to a project in Visual Studio 2010 are called SharePoint Items (SPI’s). This includes things like Web Parts, Visual Web Parts, Content Types, etc. Basically anything that has a Item Template in Visual Studio 2010 is is a SPI.

So what’s the issue? Well, in Visual Studio 2010 Beta 2, the SharePoint tools make the assumption that if you don’t have any SPI’s in the project, even if it is a SharePoint project, it will not package anything up. For instance try the following:

  • Create a new project of type Empty SharePoint Project.
  • Add a single class to the project.
  • Right-click the project name and select Package. When you look, there won’t be anything in the WSP!

But wait… even though it may not be common, wouldn’t you want to create an assembly and deploy it to the GAC/BIN of a site, but not include anything else in the package? Maybe so! Unfortunately the Visual Studio 2010 Beta 2 SharePoint tools won’t allow it. Now you can get around this behavior by building the project and then going into the Package designer to manually add a reference to the assembly. But that’s just annoying.

The good news: this is addressed in the RTM release of Visual Studio 2010… it will include any output by the project template in the WSP package. So if you’re working with beta 2, just giving you a heads up.

posted on Friday, November 20, 2009 6:55 AM

Copyright © 2003 - 2010 Andrew Connell
Creative Commons License 
This work is licensed under a Creative Commons License
Site design by Heather Solomon.

 
 
MOSS WCM Training
Looking for MOSS 2007 WCM developer training? Look no further! I teach my 5-day hands-on and online WCM classes for developers I offer through my company: Critical Path Training.

Get more information on the WCM courses!