InnerException {"Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.":"Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"} System.Exception {System.IO.FileNotFoundException}
public void TableStorageDemo()
{
storageAccount = CloudStorageAccount.Parse("connection");
tableClient = storageAccount.CreateCloudTableClient();
table = tableClient.GetTableReference("TABLE_NAME");
TableBatchOperation batchOperation = new TableBatchOperation();
var entity = new Entity();
entity.Test = "Hello World";
batchOperation.InsertOrReplace(entity);
if (batchOperation.Count() > 0) table.ExecuteBatch(batchOperation);
}
Why is the it looking for 10.0.0.0 when it has a dependency on Newtonsoft >= 10.0.2
I have tried with various versions of WindowsAzure.Storage and it only works within the Function when using version 8.7.0 which has a dependency on Newtonsoft >= 6.0.8
Another user can reproduce and suggests this is a bug.
_It seems the Function App SDK has a dependency related issue. The issue that it seems not related to WindowsAzure.Storage 9.1.1 itself. As WindowsAzure.Storage 9.1.1 and Newtonsoft 11.0.2 are working correctly in the console application._
More information about the bug detailed here: https://stackoverflow.com/questions/49812091/microsoft-windowsazure-storage-windowsazure-storage-9-1-1-failing-on-call-to-n
I am facing the same issue.
The Newtonsoft reference in https://github.com/Azure/azure-functions-vs-build-sdk/blob/1.0.13/src/Microsoft.NET.Sdk.Functions.Generator/Microsoft.NET.Sdk.Functions.Generator.csproj
is <PackageReference Include="Newtonsoft.Json" Version="[9.0.1]" /> which is causing the issue.
A PR was submitted: https://github.com/Azure/azure-functions-vs-build-sdk/pull/200 but is not yet pushed to nuget.
Any news on when this will be released please?
I'm getting the same error, any news about this?
Downgrading WindowsAzure.Storage to 8.7.0 makes it workable again.
That PR is closed instead of merged. V1 function locks Newtonsoft.Json to 9.0.1 and it won't be changed, see the explanation.
Related to this issue? https://github.com/Azure/azure-functions-vs-build-sdk/issues/266
Closing. Please see explanation.
Most helpful comment
I am facing the same issue.
The Newtonsoft reference in https://github.com/Azure/azure-functions-vs-build-sdk/blob/1.0.13/src/Microsoft.NET.Sdk.Functions.Generator/Microsoft.NET.Sdk.Functions.Generator.csproj
is
<PackageReference Include="Newtonsoft.Json" Version="[9.0.1]" />which is causing the issue.A PR was submitted: https://github.com/Azure/azure-functions-vs-build-sdk/pull/200 but is not yet pushed to nuget.