Forum Discussion
Error enabling Office 365 CDN - Method "GetTenantCdnAllowedFileTypes" does not exist
I have done the following:
- uninstalled the SDK
- restarted the SharePoint Online Management Shell
- Added reference to the DLLs with version 16.1.6323.1200 (latest as of now) via Add-Type -Path "PathToDll" for Microsoft.SharePoint.Client.dll, Microsoft.SharePoint.Client.Runtime.dll and Microsoft.Online.SharePoint.Client.Tenant.dll (I believe that the needed methods would be all in the last assembly, but added the rest of the CSOM assemblies just to be sure)
- Tried to run the script entirely in the Windows PowerShell ISE as"
$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securePassword Connect-SPOService -Credential $cred -Url $tenantAdminUrl Add-Type -Path "PathToDlls\Microsoft.SharePoint.Client.dll" Add-Type -Path "PathToDlls\Microsoft.SharePoint.Client.Runtime.dll" Add-Type -Path "PathToDlls\Microsoft.Online.SharePoint.Client.Tenant.dll" Set-SPOTenantCdnEnabled -CdnType Public -Enable $true
Still getting Set-SPOTenantCdnEnabled : Method "GetTenantCdnAllowedFileTypes" does not exist.
Thanks,
Kiril
You don't need to reference any DLLs when you are using SPO Management Shell cmdlets, so that part is definitely not needed, but it does not explain the exception what you are seeing, since that would still indicate that a wrong CSOM assembly is loaded from GAC to the execution.
Following part is not needed, since SPO cmdlet's do load the CSOM assemblies automatically. That would be only needed if you would use native CSOM in your scripts.
Add-Type -Path "PathToDlls\Microsoft.SharePoint.Client.dll" Add-Type -Path "PathToDlls\Microsoft.SharePoint.Client.Runtime.dll" Add-Type -Path "PathToDlls\Microsoft.Online.SharePoint.Client.Ten ant.dll"
- AnonymousFeb 22, 2018
Microsoft just get the situation worse !
Can't find a definitely working instruction!
The law needs to split the Microsoft in two!
- VesaJuvonenFeb 22, 2018
Microsoft
Hi George,
didn't quite get the message completely, but if you are looking for documentation, here's the official documentation in the docs.microsoft.com. Feel free to start up a new discussion in MS Tech Community and cc me in the discussion if you still have other questions or challenges.
All feedback on the documentation and guidance is more than welcome. Thanks for your input advance.
- AnonymousFeb 22, 2018
The point is that this is not a working document!
The document link that you send doesn't work. That is why people has the forum to discuss how to working around!
The Microsoft needs to have a clear document mention all the dependency of the Dlls, versions.
Currently, developers are facing Microsoft "dll hell" or "package hell". The latest package doesn't even remove the old package. The different packages over write the assemble each other.
So: In able to run this piece of code what really needs in terms of Dlls/packages/CSOM to get ride of this annoyed error "
Get-SPOTenantCdnEnabled : The term 'Get-SPOTenantCdnEnabled' is not recognized as the name of a cmdlet, function, "
?
The tool suppose to help the developers to make the life easy. Now we have to figure out which version will work and how to make the tool works!
- Kiril IlievApr 28, 2017Brass Contributor
I took another approach and something wierd happened - a console application with the latest PnP Core component NuGet package. Here is a sample code:
Tenant tenant = new Tenant(adminCtx); tenant.SetTenantCdnEnabled(SPOTenantCdnType.Public, true); adminCtx.ExecuteQueryRetry(); var isEnabled = tenant.GetTenantCdnEnabled(SPOTenantCdnType.Public);
adminCtx.ExecuteQueryRetry();
// debug mode -> check isEnabled.Value propertyAt first, it has enabled the public Cdn, but later when I tried to add a public CDN origin to one of my libraries (with the AddPublicCdnOrigin), it threw an exception that the Public CDN was disabled. Running the above code, gave me that the CDN's value was set to false for some reason, regardless if I set it again through the C# code to true.