0
votes

I read https://azure.microsoft.com/en-us/documentation/articles/batch-dotnet-get-started/#step-2-upload-task-application-and-data-files and downloaded the sample file.

I could run the sample without any issues. However , when I created a new application as a batch job with azure, I found this error in the log.

It seems like it could not find the reference. I can run my console app locally without any issue.

Base on the sample , for the job, we only need to upload the exe file to the container instead of zip the whole projects. Can anyone help me to solve this issue.

This is my error message:

Unhandled Exception: Microsoft.WindowsAzure.Storage.StorageException: Could not load file or assembly 'Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
   at Microsoft.WindowsAzure.Storage.Table.Protocol.TableOperationHttpWebRequestFactory.BuildRequestForTableOperation(Uri uri, UriQueryBuilder builder, IBufferManager bufferManager, Nullable`1 timeout, TableOperation operation, Boolean useVersionHeader, OperationContext ctx, TableRequestOptions options, String accountName)
   at Microsoft.WindowsAzure.Storage.Table.TableOperation.<>c__DisplayClass18.<RetrieveImpl>b__15(Uri uri, UriQueryBuilder builder, Nullable`1 timeout, Boolean useVersionHeader, OperationContext ctx)
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ProcessStartOfRequest[T](ExecutionState`1 executionState, String startLogMessage)
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   --- End of inner exception stack trace ---
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Table.TableOperation.Execute(CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext)
   at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext)
   at IpAddressDetect.Program.Main(String[] args)
1
Could you please try to upload the compiled TaskApplication as ZIP package into applications on azure patch service? Base on my experience, if your EXE file used other DLL library, you need put them together.Will Shao - MSFT

1 Answers

1
votes

Any task that is to be executed on a compute node must have all of its dependencies as well. In the stack trace, it appears that your task depends on the Azure Storage assembly which in-turn requires OData assemblies (among others). All of these must be packaged up as an Application Package, a single .zip resource file, or multiple resource files individually.