p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 (http://p2p.wrox.com/forumdisplay.php?f=341)
-   -   Error in Chapter 11 Sample Code (http://p2p.wrox.com/showthread.php?t=65462)

josevi January 23rd, 2008 03:16 PM

Error in Chapter 11 Sample Code
 
The sample code 'Proposal Manager' in Chapter 11 has an error in the setup.bat file that will prevent installation of the application. The bat file has the following entry in the :LDeply segment:
   echo Activating feature ProjectProposalItemEventReceiver ...
    "%SPAdminTool%" -o activatefeature -id 7b451019-6e9a-407e-8af9-b1fe9e8a5b1f -url %TargetUrl%

It has also this entry in the LRetract segment:
  echo Deactivating feature ProjectProposalItemEventReceiver ...
    "%SPAdminTool%" -o deactivatefeature -id 7b451019-6e9a-407e-8af9-b1fe9e8a5b1f -url %TargetUrl%

These are references to an inexistent feature. To install, just comment out these entries by prefacing them with 'echo"

Also, ensure that Site Definition has a unique ID. The sample uses 10001. If you have done any previous customization and used this number, installation will fail


jholliday February 1st, 2008 01:43 PM

When developing this code, I used the newly released Visual Studio Extensions for Windows SharePoint Services (VSeWSS), which has several issues. One of them is the way it generates GUIDs behind the scenes, which makes it difficult to make changes to the supporting files.

The setup.bat file in the ProposalManager solution is generated by VSeWSS, so editing it directly might not always work. It also assumes that the feature will be recreated and deployed together so the ID must match the generated GUID. If they don't match, then you will see this error.

Another approach is to make a copy of the setup.bat file and then change the activatefeature and deactivatefeature commands to use the feature name instead of the ID that VSeWSS generates. Then you will have to run the custom setup yourself, either by using a post-build action or a custom MSBuild target.

It is true that the Site Definition identifier must be unique, so you'll simply have to determine what works in your environment.

John F. Holliday, MOSS MVP


All times are GMT -4. The time now is 03:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.