For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
4 0 1 3

REST API in C# Exception thrown when calling _extractionsContext.ReportTemplateOperations.Create(template);

I have a piece of code that works fine on my development machine, but I am unable to get it to run on my colleague's machine, so I know that the issue is environmental.

In the following code an exception is thrown during the last .Create method...

var pricesnapInstrumentList = new InstrumentList { Name = sRequestReference };
 
reportTemplate.ContentFields.AddRange(dictFieldNames.Keys.ToArray());
reportTemplate.ShowColumnHeaders = true;
 
_extractionsContext.InstrumentListOperations.Create(pricesnapInstrumentList);
_extractionsContext.InstrumentListOperations.AppendIdentifiers(pricesnapInstrumentList, instrumentIdentifierList, false);
_extractionsContext.ReportTemplateOperations.Create(reportTemplate);

The exception appears to say "Exception of type 'ThomsonReuters.Dss.Api.InvalidResponseException' was thrown.", however, on further investigation it discloses the following:


'ex' threw an exception of type 'System.IO.FileNotFoundException'
    Data: {System.Collections.ListDictionaryInternal}
    FileName: null
    FusionLog: null
    HResult: -2147024894
    HelpLink: null
    InnerException: null
    Message: "Cannot load assembly 'E:\\TFS\\Develop\\VA\\Transformer\\bin\\Debug\\ThomsonReuters.Dss.RestApi.Client.dll'."
    Source: null
    StackTrace: null
    TargetSite: null


The file 'ThomsonReuters.Dss.RestApi.Client.dll' is present at the location E:\TFS\Develop\VA\Transformer\bin\Debug although the error suggests that it is not.

Any ideas what is going on here?

Thanks!
dss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
1.1k 4 3 5

Did you copy all of the SDK DLLs to the directory? Assemblies can fail to load due to missing dependent assemblies.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

I had not copied the language sub-directories to the secondary build machine.

I took a refresh of the SDK and the issue is resolved

doh!

Thanks

Upvotes
4 0 1 3

yes I copied all the DLLs (remember this is working on my own dev machine! It's as if the code is trying to load the .DLL from a different location from that reported in the exception.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
1.1k 4 3 5

I have found this to be a useful .Net tool for debugging assembly dependencies:

https://assemblyinformation.codeplex.com/

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
4 0 1 3

OK problem solved.

I had not copied the language sub-directories to the secondary build machine.

I took a refresh of the SDK and the issue is resolved

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea