1

I am using Microsoft.WindowsAzure.Storage.dll version 6.0.0 for working with Azure table storage. While adding a new entry in the table, I am getting following error.

Line of code throwing error:

var operation = TableOperation.InsertOrReplace(entity);

await this.CloudTable.ExecuteAsync(operation).ConfigureAwait(false); -> // Throws error

where entity is of type TableEntity

I have referenced following assemblies:

<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net451" />
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net451" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net451" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="System.Spatial" version="5.6.4" targetFramework="net451" />
<package id="WindowsAzure.Storage" version="6.0.0" targetFramework="net451" />

Note: The code execute fine when run on my local machine, but throws above exception when run on a different environment which we don't own. (Different set of machines hosted somewhere else, and also we don't have access to these machines)

Error:

Error: System.EntryPointNotFoundException: Entry point was not found.#R##N# at Microsoft.WindowsAzure.Storage.Table.ITableEntity.get_PartitionKey()#R##N# at Microsoft.WindowsAzure.Storage.Table.TableOperation.GenerateCMDForOperation(CloudTableClient client, CloudTable table, TableRequestOptions modifiedOptions)#R##N#
at Microsoft.WindowsAzure.Storage.Table.TableOperation.BeginExecute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, Object state)#R##N# at Microsoft.WindowsAzure.Storage.Table.CloudTable.BeginExecute(TableOperation operation, TableRequestOptions requestOptions, OperationContext operationContext, AsyncCallback callback, Object state)#R##N# at Microsoft.WindowsAzure.Storage.Table.CloudTable.BeginExecute(TableOperation operation, AsyncCallback callback, Object state)#R##N# at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.TaskFromApm[T1,TResult](Func 4 beginMethod, Func 2 endMethod, T1 arg1, CancellationToken cancellationToken)#R##N# at Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteAsync(TableOperation operation, CancellationToken cancellationToken)#R##N# at Microsoft.WindowsAzure.Storage.Table.CloudTable.ExecuteAsync(TableOperation operation)#R##N# at Microsoft.OnlinePublishing.Retry.TaskRetryer 2.DoAction()#R##N#--- End of stack trace from previous location where exception was thrown ---#R##N# at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)#R##N# at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)#R##N# at System.Runtime.CompilerServices.ConfiguredTaskAwaitable 1.ConfiguredTaskAwaiter.GetResult()#R##N# at Microsoft.OnlinePublishing.Ingestion.Common.Cache.CloudTableManager.d__6 1.MoveNext()

halfer
  • 19,824
  • 17
  • 99
  • 186
Jash
  • 942
  • 4
  • 17
  • 40
  • It is a DLL Hell problem. If you can't do anything about what is deployed on those machines then it won't get better until you target and test with the exact same versions of the DLLs that are on that machine. Somebody can tell you what they are, not us. – Hans Passant Oct 23 '15 at 14:32
  • Yeah i know that :) The purpose of posting this question here is to know which DLL could be causing this problem. As you can see the stack trace. I check the code using ILSpy, but didn't found anything. May be folks from Windows Azure Stroage can comment or someone more familiar or faced this situation. I don't know why someone wants to close this – Jash Oct 23 '15 at 14:48
  • I would ask them what version of Windows.Azure.Storage is on the target machine. Alternately, are you including that dll with your deployed files? – Robin Shahan - MSFT Oct 23 '15 at 16:32

1 Answers1

0

This exception indicates that there is a version mismatch of reference assembly "Microsoft.WindowsAzure.Storage.dll" between the assembly that defines your TableEntity type and the assembly that is operating on it.

Which version of "Microsoft.WindowsAzure.Storage.dll" is referenced by the assembly where your TableEntity type is defined?

  • The assembly where TableEntity is defined refers version "6.0.0" with target framework 4.5.1 – Jash Oct 27 '15 at 10:26
  • I originally missed Robin's question, could you check the version of Windows.Azure.Storage assembly that is on the target machine and whether you are including that with your deployed files? In addition, are there multiple assemblies passing TableEntity objects between them and did you have any binding redirects configured for those assemblies? – Mine Tanrinian Demir - MSFT Oct 28 '15 at 17:29