0

I successfully integrate/reference a third party assembly. I tried to use one of the namespace after that I encountered an error that I cannot solve. Here's the simple code:

        public string Post()
        {
            // SpeechDocument(String waveFilePath, String authorName, String reportingGroup, Boolean isTelephonyFile)
            SpeechDocument doc = new SpeechDocument("C:\...\00000001.wav", "Cedrick", "General Medicine", false);
            return "success";
        }

The errors are:

   at System.IO.Path.Combine(String path1, String path2)
   at RSDK.Internal.Common.RSDKContainer.get_CurrentProcessLogFileNameWithPath()
   at RSDK.Internal.Core.SpeechDocumentCore.#=z$5Q2T_xRYoga()
   at RSDK.Internal.Core.SpeechDocumentCore.EndEditing(Boolean #=zTYSHoeyj3r48ojXOIRdOcpA=, AudioRecorderEvent[] #=zbELmHJ$IRdFI, RecognitionSessionEvents #=zBhjJtc_kJDyoD0OJyFahi54=)
   at RSDK.Reporting.SpeechDocument.#=zP0d4cWexHDDrvOhI7Q==(Byte[] #=zF8R1D8iiYw7u, String #=znyXcsaU=, String #=z7F6fUgeQvXwBuhoM2Q==, Boolean #=zX9EJOBrNDRht3FrkZg==)
   at RSDK.Reporting.SpeechDocument..ctor(String waveFilePath, String authorName, String reportingGroup, Boolean isTelephonyFile)
   at RSDKAPII.Controllers.ValuesController.Post() in C:\Users\Cedric\Desktop\TestProject\RSDKAPII\Controllers\ValuesController.cs:line 51
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)

The error pointing inside of constructor while the wav path is outside of the project. I didn't use Path.Combine and I can't solve the SystemArgumentNullException which is the Parameter name: path2. I'm glad if someone can help me through this.

Newbie
  • 13
  • 4
  • You must be missing some configuration somewhere that's preventing that library to function correctly. You'll need to refer to its documentation on how to get started. Judging by the stack trace, looks like it's trying to set up logging and trying to do that based on your current working directory or something. It's possible that it's expecting your resource files to be in a particular location by default. – Jeff Mercado Jan 24 '23 at 07:34
  • @JeffMercado I'll explain how I created the project: - Created in VS 2019 Web API template with target framework 4.8. - I went to Properties of a project and did a reference path where the third party assemblies located and did Add Reference. - I did not edit any default including config files. I just used the methods and used the only feature of a project, as you can see above, I used ValuesController to test the method that I want to use. Build with IISExpress. BTW, I am newbie in the C# and in the framework so any configuration I don't know how/what to configure it – Newbie Jan 24 '23 at 08:37
  • `"C:\...\00000001.wav"` is not even a valid string literal. – Klaus Gütter Jan 24 '23 at 09:12
  • @KlausGütter it's just for an example sir. I actual use the full path in my local. – Newbie Jan 24 '23 at 09:59
  • Also the stack trace tells that the exception occurs in the `Get()` method, not in `Post()` – Klaus Gütter Jan 24 '23 at 10:03
  • @KlausGütter I updated the stack trace sir, can you check it again. – Newbie Jan 24 '23 at 10:09
  • 1
    What is `RSDK`? The error is raised in `get_CurrentProcessLogFileNameWithPath`, where `RSDK.Internal.Core.SpeechDocumentCore` is trying to retrieve a log file location. I suspect some configuration setting is missing or has the wrong value – Panagiotis Kanavos Jan 24 '23 at 10:13
  • @PanagiotisKanavos RSDK is a third party assemblies/outside libraries of the project. It is a SDK of the app. Probably the configuration settings but I don't how/what to configure in the project. I'm new in the framework and C#. – Newbie Jan 24 '23 at 10:18
  • 1
    Did you check that library's documentation? We can't tell you what it is when we don't even know that library's name. And even if you post the name, we'll have to go to that product's web site and look at the docs – Panagiotis Kanavos Jan 24 '23 at 10:21
  • @PanagiotisKanavos In the documentation, there's no part that the library(RSDK) is use in Web API or a step by step on how to configure it in the web-based. But, they said it can run in web-based, it's true I tried to used other methods and its running but the only not running is that line of code. – Newbie Jan 24 '23 at 10:32
  • Do I have to configure IISExpress for this? or what file I have to configure or setup. The file/filepath is not corrupt and its existing. – Newbie Jan 24 '23 at 10:34
  • How can we guess? We don't even know what library you're using. *You* have access to that library and its documentation. Did you try searching for the word `log` in the docs? The error complains about a log path, not about a sound file. Did you check that library's docs for log settings? – Panagiotis Kanavos Jan 24 '23 at 10:37
  • So the error is not cause by the project, it cause by the library? Am I right? – Newbie Jan 24 '23 at 10:40
  • I'll try to search, the documentation is not fully detailed that's why I have a hard time to solve this. – Newbie Jan 24 '23 at 10:41

0 Answers0