Wednesday, 8 September 2010

Changing a VS2010 SharePoint package name

The SharePoint development tooling built into Visual Studio 2010 does a pretty good job at hiding some of the ugly bits involved in creating a SharePoint solution file. No longer must we deal with ddf files (hooray!) but we also lose some control (or, at the very least, have to dig a bit further to change some things that were previously "easy" in the broader context of "really painful").

One of those things that we previously had full control over was the name of the solution file (.wsp) that results from our ddf file and the mighty makecab.exe. While the file name is now set from within Visual Studio, you have to open the package designer before being presented with the package properties:

Rename-solution-file-vs2010
Simply clicking on the Package.package file will present you with the file properties which is not what you want—you have to double-click/open the package designer.

The one thing I used to do with the ol' ddf file was specify the extension as .cab instead of .wsp. This was a convenience thing—SharePoint doesn't care about the extension (or at least doesn't object to .cab files)—but a .cab file will open in Windows Explorer on machines where you don't have a better archive tool installed like my favourite, 7zip. Essentially, it just saved me having to rename the file by hand.

Unfortunately I have yet to find a way to do this with VS2010; the package name is only that—Visual Studio appends ".wsp" to the end of whatever name you supply and I can't find a way to override that behaviour. In truth I'll probably just start using .wsp like everyone else but it may be possible to tweak the file name in one of the pre/post events.

If you found this post helpful, please support my advertisers.

2 comments:

  1. I am leaning toward going wsp as well. You think thats because I'm lazy. But thats true.

    Why fight the uphill battle for this. There will be other things to sap the very life energy from us. :) Additionally, I wonder if this is a sign of future limitations...

    ReplyDelete
  2. Yeah, it's a minor one for sure. End of the day with 7zip: right-click, 7zip -> Open Archive does what I want anyway.

    ReplyDelete

Spam comments will be deleted

Note: only a member of this blog may post a comment.