none
Project Site - Delete and ReCreate using WssInterop RRS feed

  • Question

  • Hello,

    I currently have a console application that loops through all rpojects and deletes all of their sites and recreates them using a new template associated with an EPT. This works fine.

    I also have a WssInteropWorkspaceCreated event handler that assigns a group with full control to the project site. This also works fine whether a new project is created or whether a site is created manualy from server settings project sites.

    Together, they do not work.

    When I run my tool to delete and create each site one by one, my event handler fires each time, and reports successful execution, however if you navigate to the site the group was not added. 

    Furthermore, After I run my "Mass Delete/ReCreator", manually creating a project site from server settings fires my event handler, but no longer adds the group. Again, all entries into the ULS logs show success, there are no errors anywhere.

    Any Ideas?

    I call wss.deleteSIte and wss.CreateSite for each project site. Simple and straightforward. So I thought.


    120811049008

    EDIT: I should add, deregistering and registering my event after I run my mass deleter/recreator makes the event handler work properly again. (until i run the mass deleter/recreator)
    • Edited by Paul MC2 Saturday, July 7, 2012 5:07 PM
    Saturday, July 7, 2012 4:58 PM

Answers

  • Hey Paul,

    just a thought, but maybe SharePoint/ProjectServer "fixes" your permissions on workspace sites. You add a group which is not a member of the project team. Run a test with unchecking the "Project Site Permissions" checkbox in "Project Site Provisioning Settings". 

    Greets
    Maik

    • Marked as answer by Paul MC2 Monday, July 9, 2012 4:48 PM
    Monday, July 9, 2012 4:35 AM
  • Hello,

    Actually I solved the problem. Turns out you were right, in a way.

    Sometimes, my event was firing before project server's initial sync of permissions. In these cases, my permissions were overwritten.

    Other times, my event fired after the initial permission sync. In these cases, my permissions stayed.

    In order to get around this, I put a Thread.Sleep( 2000 ) at the start of my event handler and it works all the time now.


    120811049008

    • Marked as answer by Paul MC2 Monday, July 9, 2012 4:48 PM
    Monday, July 9, 2012 4:48 PM

All replies

  • Hey Paul,

    just a thought, but maybe SharePoint/ProjectServer "fixes" your permissions on workspace sites. You add a group which is not a member of the project team. Run a test with unchecking the "Project Site Permissions" checkbox in "Project Site Provisioning Settings". 

    Greets
    Maik

    • Marked as answer by Paul MC2 Monday, July 9, 2012 4:48 PM
    Monday, July 9, 2012 4:35 AM
  • Hello,

    Actually I solved the problem. Turns out you were right, in a way.

    Sometimes, my event was firing before project server's initial sync of permissions. In these cases, my permissions were overwritten.

    Other times, my event fired after the initial permission sync. In these cases, my permissions stayed.

    In order to get around this, I put a Thread.Sleep( 2000 ) at the start of my event handler and it works all the time now.


    120811049008

    • Marked as answer by Paul MC2 Monday, July 9, 2012 4:48 PM
    Monday, July 9, 2012 4:48 PM