Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am creating sites and subsites with object model from a console app. And what i realized is, it fires twice for every newly created subsite. I checked from Sharepoint Manager if the event receiver is registered twice, but no there are no multiple registrations. So what can cause the WebProvisioned event firing twice?

Edit: I have found a blog article that says the webprovisioned event is firing twice, and the author also does not know why. the article

One other interesting “feature” (a rather peculiar one) is that when I tested my sample “Site” scoped WebProvisioned receiver it got called twice for one and the same site (no idea yet if this is an issue with my dev environment only or it is something by design). This is not the case for “Web” scoped WebProvisioned receivers.

share|improve this question
    
Is you last question solved ? Was my answer helpful ? –  Arsalan Adam Khatri Dec 4 '12 at 15:02
    
yes, thanks. i marked it as answer. what about current problem?do you have any idea? –  ozdogan Dec 4 '12 at 15:05
1  
To realise the solution to this we would need a code sample, of course please edit your post and include one with your addresses and file names taken out and replaced by place-holder names –  Hugh Wood Dec 4 '12 at 15:07
    
The code is real huge.. But As i know this kind of problem may be faced, for example in ItemUpdating events, when the current item is updated in the Updating event receiver. But here in my situation, a site cannot be provisioned/created twice. This is not like ItemUpdating event. –  ozdogan Dec 4 '12 at 15:10
    
@ozdogan code will help to solve the issue! –  Arsalan Adam Khatri Dec 4 '12 at 15:40
show 3 more comments

1 Answer

Can you follow this article. Because long way back I got a chance to work on WebProvisioned Event in SharePoint 2010. I would suggest to follow this article.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.