Pregunta

Tengo que desactivar el MDS al aprovisionar mis sitios. He intentado con un receptor de eventos en una función personalizada, pero parece que cuando ejecuto este código en el receptor

Guid featureGuid = new Guid("87294C72-F260-42f3-A41B-981A2FFCE37A");
if (mySiteWeb.Features[featureGuid] != null)
{
     mySiteWeb.Features.Remove(featureGuid);
}

no pasa nada.

Esto solo funciona una vez que se crea el sitio MI y en toda la interfaz de usuario.Si voy a Manage Site Features y desactiva y active mi función personalizada manualmente, los MDS se apagan.

¿Alguna idea de cómo lograr esto?

¿Fue útil?

Solución

We had the same problem. We had a stapling feature that was applying branding to my personal sites. Staplers code ran, but MDS was still active. What we did, was to add a custom control to a personal site master page which deactivated MDS when site was loaded. In this custom control we added if/else check if this code ran once ( by putting value to web.properties) and if it did already, just did not deactivate it again.

We were able to do this, as this was a farm solution. If you are on Office 365 etc, you need to do "Application Stapling"

http://blogs.msdn.com/b/richard_dizeregas_blog/archive/2013/03/04/sharepoint-2013-app-deployment-through-quot-app-stapling-quot.aspx

Otros consejos

PowerShell below will update the current farm “MDSFeature” XML to disable for all newly created site collections and child webs. If you need to support IE8 and older browsers this can be helpful. The feature GUID technically remains active but won’t do anything with missing DLL assembly detail. After desktops upgrade (IE11/Win8) then this change can be reversed with a simple file copy “ORIG” back to “XML.” Hope this helps!

http://www.spjeff.com/2015/02/13/knee-cap-mds-disable-for-new-and-current-sites/

# Disable MDS - run once per farm
# unregister Feature definition from ConfigDB
Uninstall-SPFeature MDSFeature -Force -Confirm:$false

# backup current Feature XML
$path = "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\MDSFeature\feature.xml"
Copy-Item $path "$path-orig"

# modify Feature XML to suppress DLL assembly detail  (still registered, but unable to run)
[xml] $x = Get-Content $path
$x.Feature.RemoveAttribute("ReceiverClass")
$x.Feature.RemoveAttribute("ReceiverAssembly")
$x.Save($path)

# register Feature to ConfigDB
Install-SPFeature MDSFeature

I'm not finished testing this, but if you're changing the master page, you can add the following to disable MDS(it will render the page in standard mode nomatter if MDS is activated or not):

<SharePoint:PageRenderMode runat="server" RenderModeType="Standard" />
Licenciado bajo: CC-BY-SA con atribución
scroll top