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 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??

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 Jun 23 '11 at 0:00
    
update: Changed approach to use Activation Dependency with 2 features, one hidden. Works perfectly. –  zee Jun 26 '11 at 23:54

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.