Home » Visual StudioRSS

Retracting feature which deployed custom master page delete default.master

Hi, I am not sure if solution to this issue is already posted?

I have my feature which copy my custom.master which is copy of default.master from hive to master page gallery of web. The problem is that everything works fine with feature activate and deactivate but when I retract the solution from the server. All pages except site settings page stop working saying "file not found". I redeploy the solution, it starts working again.

Looks like the retract is deleting default.master as well? I have this issue in 2010 as well. Any help will be appreciated.

Thanks,

Kashish

 

3 Answers Found

 

Answer 1

Is your feature  coded to use CAML or does it use a feature receiver.  Assuming its CAML, for security reasons the deactivate  methods aren't wired up.  That means if you deactivate a feature coded with CAML nothing really happens --- for exactly the reason you mention in your question.  If you left your custom  master page  selected when you retracted the solution  (which does remove the files) then you'd get that error. 

If this is what's happening then I'd assume if you were to go straight to the settings  page and bypass the landing page if you selected another master  Page the site  would come up again.

My suggestion would be to switch the master page to something out of the box before retracting  the solution.  Or if you are updating the master page look into upgrading the solution instead of retracting and redeploying.  Another option would be to use a feature receiver that has the deactivate events wired up so that when the feature is deactivated it automatically sets to an OOB master page.

 

Answer 2

Hi John,

I am also facing a similar problem  as Kashish. I am using a feature  receiver and in the deactivate  code, I am changing the master  page back to v4.master. During retraction, my home page  is giving an error - "404 page not found", but I am able to view the settings  page by typing the url.

I am facing this issue  with new sites created. I am stapling my feature to the site  templates. I activated my publishing features and checked which master page was applied to my site. It was showing v4.master, but I am still getting the error. Does the v4.master get corrupted as I am changing the master page on site creation?

If you could provide any inputs, then that would be great.

Thanks,

Neha

 

Answer 3

Hi,

I am also facing the same issue. Did u get a solution for this?

Regards,

Neha

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Tech Videos   |   Follow us on Twitter