在我的 Azure 函数中,我引用了Microsoft.WindowsAzure.Management.WebSites
程序集
{
"frameworks": {
"net46":{
"dependencies": {
"Microsoft.WindowsAzure.Management.WebSites": "4.0.0"
}
}
}
}
并尝试使用WebSiteManagementClient
:
var client = new WebSiteManagementClient(
new Microsoft.WindowsAzure.CertificateCloudCredentials("my sub ID", cert));
但它失败并出现错误:
Microsoft.WindowsAzure.Common:
The type initializer for 'Microsoft.WindowsAzure.Common.ServiceClient`1'
threw an exception. Microsoft.WindowsAzure.Common: Operation is not
supported on this platform.
在日志中我可以看到
Unable to find assembly 'Microsoft.WindowsAzure.Common.NetFramework'. Are you missing a private assembly file?
Unable to find assembly 'Microsoft.WindowsAzure.Common.WindowsStore'. Are you missing a private assembly file?
Unable to find assembly 'Microsoft.WindowsAzure.Common.WindowsPhone'. Are you missing a private assembly file?
Unable to find assembly 'Microsoft.WindowsAzure.Common.WindowsPhone81'. Are you missing a private assembly file?
Unable to find assembly 'Microsoft.WindowsAzure.Common.Silverlight'. Are you missing a private assembly file?
Unable to find assembly 'Microsoft.WindowsAzure.Common.Test'. Are you missing a private assembly file?
我也尝试引用所有相关的 NuGet 包,但没有修复错误。
我错过了什么?