2

I want to REPLACE the person.aspx page in the OOTB My Sites Host portal in SharePoint 2010

It works perfectly fine if:

Case 1:

  1. I open My Sites using SharePoint Designer 2010
  2. DELETE the person.aspx file under 'All Files'
  3. Deploy a Solution/Feature with a Module component that provisions a new person.aspx file with the changes I require

OR

Case 2:

I 'Deploy' my project with the same Feature and Module component using Visual Studio 2010, because VS 2010 detects a conflict and this effectively runs a 'DELETE' on the existing person.aspx file

HOWEVER

If I deploy the exact same thing using the wsp package and Central Administration, it no longer works, because it's not able to 'delete' the existing person.aspx in order to provision my new person.aspx file.

Can someone please help?

What is the magic code that SP Designer and VS 2010 run to be able to delete this file??

1 Answer 1

1

You could try adding a Feature Receiver (on FeatureActivated) to delete the existing page, but this will only run after your file gets provisioned. To get around this, you could create 2 features, one visible, one hidden. The visible feature has an ActivationDependency on the second hidden feature which means the hidden feature will get activated automatically first when you activate the visible feature (see http://msdn.microsoft.com/en-us/library/aa543162.aspx) - you can use this to remove the file using a Feature Receiver as mentioned. I would then expect the visible feature to activate afterwards. Try it, but I think it might work for you.

2
  • Activation Dependency with 2 features, that's a great idea! Thanks for that. I ended up running a Powershell script to delete the file first and then activate my feature that provisions the person.aspx file. Does seem more klunky than your way though.
    – zee
    Commented Jun 23, 2011 at 0:00
  • update: Changed approach to use Activation Dependency with 2 features, one hidden. Works perfectly.
    – zee
    Commented Jun 26, 2011 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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