I have invalidly hooked feature reciever. Feature has two configuration files The first, SharePoint looks like this:
< feature xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" Id="94bb0bbe-ba87-4ff4-accd-6cd429b337ad" featureId="94bb0bbe-ba87-4ff4-accd-6cd429b337ad" imageUrl="" solutionId="00000000-0000-0000-0000-000000000000" title="Alokacie" version="" deploymentPath="$SharePoint.Project.FileNameWithoutExtension$_$SharePoint.Feature.FileNameWithoutExtension$" xmlns="http://schemas.microsoft.com/VisualStudio/2008/SharePointTools/FeatureModel">
< projectItems>
< projectItemReference itemId="84752a89-37b6-401d-9353-034b10f3671c" />
< projectItemReference itemId="c829a4dc-2469-4ab5-a3e1-4a3bfce1c552" />
< /projectItems>
< /feature>
and the second one, feature template:
< Feature ReceiverAssembly="FeatureBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cf0c34879675fa15" ReceiverClass="FeatureBuilder.FeatureReciever" xmlns="http://schemas.microsoft.com/sharepoint/">
< /Feature>
When I try to register eventhandler in the first one (feature file) nothing happend. Even in SharePointManager are empty properties: ReceiverAssembly, ReceiverClass. Now I'm able to deploy without problems. When I register eventhandler in the second one, as you can see above, SharePointManager after failed deployment shows that ReceiverAssembly and Class is what I expect. But deployment fails due to error:
"Error occurred in deployment step 'Activate Features': Expression must evaluate to a node-set."
Receiver method:
System.Diagnostics.Debugger.Launch();
var service = SPWebService.ContentService;
var myModification = new SPWebConfigModification();
myModification.Path = "configuration/AplikaceRoly";
myModification.Name = "add[@name=Name]";
myModification.Sequence = 0;
myModification.Owner = "NESS";
myModification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
myModification.Value = "<add key='sth' value='Sth'/>";
service.WebConfigModifications.Add(myModification);
service.ApplyWebConfigModifications();
service.Update();
When I remove ReceiverClass nad ReceiverAssembly attributes I can deploy without problems again.
Have somebody idea what's wrong? I can't find simmilar problems on google.