When you are using Microsoft Speech Platform in your web service to perform speech recognition, you might find a strange situation when the web app works perfectly in Visual Studio, but keep having “Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))” when you try to instantiate SpeechRecognitionEngine.
After some searches on the Internet, I found 2 suggestions in this article http://stackoverflow.com/questions/3385382/run-microsoft-speech-over-iis:
- Use procmon in SysInternals to find ACCESS DENIED result and add permission there
- Grant read permission for the IIS apppool account to folder
1C:\windows\system32\config\systemprofile\appdata\roaming
I tried the second suggestion first as it is more straight forward, but it didn’t work out for me. I then tried the first suggestion.
Turned out the path is a bit different on my PC, probably due to x64-x86 compatibility.
I added read permission for
1 |
IIS APPPOOL\{name} |
to the folder above (and some of its parents), and the speech platform works perfectly in IIS now.
I hope this article would help you if you have to same issue. Please also leave a comment if you have a better solution.