Hi I am developing a Feature in Sharepoint 2010. In the c# code I am creating sub sites, and lists, but if somethig goes wrong I catch the problem and set an event viewer entry.
The problem is that when the error goes to the catch part, in the UI the feuture shows “activated” while it failed !. Is there a way to indicate to sharepoint that something went wrong and that the feature installations failed?, and is marked as “Activate”?
Thanks !!!
Make sure you ar enot using “-force” flag when ativating (if using command line) – it will mark feature activate irrespective of success.
Throw an exception as result of activation – SharePoint will not mark feature activated. (This is likley why your feature is marked as activated as you eat excetpion).