I have created a WebAPI project in .Net Core (3.1) that references / has a dependency to a second project in my solution.
It works perfectly on my local machine, but I published it to my web-host, and I am getting 500 errors from a specific POST method that is using the referenced project.
When I examine the output log, the error looks as follows:
Connection id "0HMFHNV7NFO0R", Request id "0HMFHNV7NFO0R:00000010": An unhandled exception was thrown by the application.
System.UnauthorizedAccessException: Access is denied. (0x80070005 (E_ACCESSDENIED))
at System.Speech.Internal.SapiInterop.ISpRecognizer.SetRecognizer(ISpObjectToken pRecognizer)
...
at <Referenced project & method> in
C:\Users\<username>\...\...\....cs:line 23
Basically, from what I'm seeing, it seems my API is actually trying to access the referenced project at it's original location on my local machine (C:\Users\<username>..........cs:line 23).
I truly don't understand what's happening here since the rest of the API seems to work well except for the parts referencing the other project, but that doesn't make sense to me since .Net core should just supply the relevant DLLs, no?
As a second part to this question as well, the second (referenced project) is using System.Speech
which is available in .Net Core 3.1, but I am being told from my hosting provider:
System.Speech requires LocalSystem of Application Pool Identity if you use it in a .net web application. I don't have a better solution, perhaps you can try another Speech library which can work individually for your project.
Is this logical or, since it is a .Net Core package, is it fully self-contained and doesn't need that?
And, more importantly, is there any way to fix to be able to keep using this library?
What can I do to fix this / what does this error mean?