Failed to load type "Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob" from the assembly "Microsoft.WindowsAzure.Storage, Version = 4.3.0.0

I start user activity in Azure factory data, when I try to work with CloudAppendBlob, the following exception occurs. This seems like a version issue, but fails to figure out a fix. I compiled the code using Windows Azure Storage 7.0.0. Please, help!

Unknown error in module:

System.Reflection.TargetInvocationException: exception thrown on the target of the call. ---> System.TypeLoadException: Can it not load the type "Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob" from the assembly 'Microsoft.WindowsAzure.Storage, Version = 4.3.0.0, Culture = Neutral, PublicKeyToken = 31bf3856ad364e35'. in MyDotNetActivity.SampleActivity.Execute (IEnumerable 1 linkedServices, IEnumerable 1 dataset, activity activity, logctivityLogger logger) in Microsoft.Azure.Management.DataFactories.Runtime.ActivityExecutor.Execute (Job object, string configuration, Action`1 logAction - - End of the internal trace of the exception stack - with System.RuntimeMethodHandle.InvokeMethod (Object target, Object [] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal (Object obj, Object [], Object [] arguments) in System.Reflection.RuntimeMethodInfo.Invoke (Object obj, BindingFlags invokeAttr, binder, Object [] parameters, CultureInfo culture) in Microsoft.DataPipeline.Compute.HDInsightJobExecution.ReflectingActivityWrapper.Execute () in e: _Bld \ 12752 6 \ Sources \ Product \ Common \ Compute \ SRC \ HDIComputeDelegatorJob \ ReflectingActivityWrapper.cs: line 44 in Microsoft.DataPipeline.Compute.HDInsightJobExecution.JobWrapper.RunJob () in e: _Bld \ 12752 \ 4106 \ Sources \ Product \ Common \ SRC \ HDIComputeDelegatorJob \ JobWrapper.cs: line 94 in Microsoft.DataPipeline.Compute.HDInsightJobExecution.Launcher.Main (String [] args) in e: _Bld \ 12752 \ 4106 \ Sources \ Product \ Common \ Compute \ SRC \ HDIComputeDelegator Launcher.cs: line 78.

+6
source share
2 answers

I myself faced the same problem. It turns out that Azure Data Factory is limited to Microsoft.WindowsAzure.Storage version 4.3. To download another version, you should take a look at Microsoft CrossAppDomainDotNetActivitySample .

From the readme file:

This example allows you to create custom .NET activity for ADF that is not limited to the build versions used when running ADF (for example, WindowsAzure.Storage v4.3.0, Newtonsoft.Json v6.0.x, etc.) ..

The code includes an abstract base class (CrossAppDomainDotNetActivity) that implements application domain isolation and a sample derived class (MyDotNetActivity) that demonstrates the use of WindowsAzure.Storage v6.2.0.

Note. Public types opened by the ADF SDK cannot be serialized across application domain boundaries. Thus, the derived class must provide pre-order logic (PreExecute) for processing ADF objects in a serializable object, which is then passed to the main logic (ExecuteCore).

+7
source

In your app.config, add the following assembly binding redirects :

  <dependentAssembly> <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0"/> </dependentAssembly> 

If after that you encounter other similar problems, add assembler redirects for these assemblies.

0
source

All Articles