Question

Je dois désactiver le MDS lors de l'approvisionnement de mes sites. J'ai essayé avec un récepteur d'événements dans une fonctionnalité personnalisée, mais il semble que lorsque j'exécute ce code dans le récepteur

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

rien ne se passe.

Ceci fonctionne uniquement une fois que le site est créé et tout au long de l'interface utilisateur.Si je vais à Manage Site Features et désactivez et activez ma fonctionnalité personnalisée manuellement, le MDS s'éteint.

Une idée de la manière de y parvenir?

Était-ce utile?

La solution

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

Autres conseils

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" />
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top