azure - 无法从程序集“Microsoft.WindowsAzure.Storage,版本 = 4.3.0.0”加载类型 'Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob'

标签 azure azure-storage custom-activity

我正在 Azure 数据工厂中运行自定义事件,当我尝试在 CloudAppendBlob 上工作时,会发生以下异常。看起来像是版本问题,但无法找到解决方法。我使用 Windows Azure Storage 7.0.0 编译了代码。请帮忙!

模块中的未知错误:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob' from assembly 'Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. at MyDotNetActivity.SampleActivity.Execute(IEnumerable1 linkedServices, IEnumerable1 datasets, Activity activity, IActivityLogger logger) at Microsoft.Azure.Management.DataFactories.Runtime.ActivityExecutor.Execute(Object job, String configuration, Action`1 logAction) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.DataPipeline.Compute.HDInsightJobExecution.ReflectingActivityWrapper.Execute() in f:_Bld\12752\4106\Sources\Product\Common\Compute\src\HDIComputeDelegatorJob\ReflectingActivityWrapper.cs:line 44 at Microsoft.DataPipeline.Compute.HDInsightJobExecution.JobWrapper.RunJob() in f:_Bld\12752\4106\Sources\Product\Common\Compute\src\HDIComputeDelegatorJob\JobWrapper.cs:line 94 at Microsoft.DataPipeline.Compute.HDInsightJobExecution.Launcher.Main(String[] args) in f:_Bld\12752\4106\Sources\Product\Common\Compute\src\HDIComputeDelegatorJob\Launcher.cs:line 78.

最佳答案

我自己也遇到过同样的问题。事实证明,Azure 数据工厂仅限于 Microsoft.WindowsAzure.Storage 版本 4.3。为了加载不同的版本,您应该查看 Microsoft 的 CrossAppDomainDotNetActivitySample .

来自自述文件:

This sample allows you to author a custom .NET activity for ADF that is not constrained to assembly versions used by the ADF launcher (e.g., WindowsAzure.Storage v4.3.0, Newtonsoft.Json v6.0.x, etc.).

The code includes an abstract base class (CrossAppDomainDotNetActivity) that implements app-domain isolation and a sample derived class (MyDotNetActivity) that demonstrates using WindowsAzure.Storage v6.2.0.

Note: The public types exposed by the ADF SDK are not serializable across app domain boundaries. As such, the derived class must provide pre-execution logic (PreExecute) to process the ADF objects into a serializable object that is then passed to the core logic (ExecuteCore).

关于azure - 无法从程序集“Microsoft.WindowsAzure.Storage,版本 = 4.3.0.0”加载类型 'Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37989083/

相关文章:

azure - 我可以使用哪些 Microsoft Graph 用户属性来获取每个用户的附加信息

amazon-web-services - 将 Power BI 连接到 S3 存储桶

api - 如何通过使用自定义 apiKey(而不是订阅 ID)在 azure api 管理中使用速率限制?

python - 导入错误 : No module named azure. storage.blob

c# - Azure CloudBlockBlob。 DownloadToStream 时找不到 blob。 Uri 似乎重复了?

azure - 我想提取在 MS Azure Synapse 中存储为 varchar(max) 的匹配标记的 XML 值

ios - UIActivityViewController:视频分享到 Youtube

azure - ADF IActivityLogger 记录器存储在哪里?

azure - 定期在azure中运行exe