views:

93

answers:

1

Hello,

I have an app that uses Microsoft.Speech to recognize speech in a WAV file. It works perfectly when run locally as a console app but barfs when executed by IIS.

Assuming I have the following installed on WinServer 2008 with .NET 3.5+:

  1. Microsoft Speech Platform - Software Development Kit (SDK) (Version 10.1)
  2. Microsoft Speech Platform - Server Runtime Languages (Version 10.1)
  3. Microsoft Speech Platform - Software Development Kit (SDK) (Version 10.1)

Is it even possible to use Microsoft.Speech over IIS7? What am I missing here?

I've tried re-coding it as an ASP.NET web service but that doesn't work either.

Suuuuper stuck here. Thanks if you can help :) Pretty please :)

UPDATE: Here's the error message + stack trace:

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.Speech.Internal.SapiInterop.ISpRecognizer.CreateRecoContext(ISpRecoContext& ppNewCtxt) 
at Microsoft.Speech.Internal.SapiInterop.SapiRecognizer.<>c__DisplayClass17.b__16() 
at Microsoft.Speech.Internal.SapiInterop.SapiProxy.PassThrough.Invoke(ObjectDelegate pfn) 
at Microsoft.Speech.Internal.SapiInterop.SapiRecognizer.CreateRecoContext() 
at Microsoft.Speech.Recognition.RecognizerBase.Initialize(SapiRecognizer recognizer, Boolean inproc) 
at Microsoft.Speech.Recognition.SpeechRecognitionEngine.get_RecoBase() 
at Microsoft.Speech.Recognition.SpeechRecognitionEngine.Initialize(RecognizerInfo recognizerInfo) 
at Microsoft.Speech.Recognition.SpeechRecognitionEngine..ctor() 
at myRecognize.Recognize..cctor() The type initializer for 'myRecognize.Recognize' threw an exception. myRecognize 
at myRecognize.Recognize.get_Reco() 
at myRecognize.Recognize.Listen(String wavLoc, String grammars) 
A: 

Shot in the dark: it's trying and failing to load some files from disk, from an area the IIS app pool user doesn't have permission to read.

Try running sysinternals ProcessMon to find out which, then grant the app pool user (or local group IIS_IUSRS if you haven't changed the app pool user) permissions to that directory.

Rup
Thanks for the suggestion. I'm trying to use ProcessMon but it spits out so many records and I'm not sure what to filter for. I tried filtering for only error messages involving my speech recognition .exe but can't really single anything out. Have any suggestions for what I should look for?
Aaron
Filter on Result is ACCESS DENIED? I'm not sure what the IIS process is on 2008 sorry.
Rup
Okay, I'll take a look. Thanks for your help... I'll report back.
Aaron
I'm wondering if my problem is related to Partially Trusted Caller settings. I'm aware that several parts of Microsoft.Speech are only allowed by fully-trusted callers. Here's an article: http://blogs.msdn.com/b/shawnfa/archive/2005/02/04/367390.aspx I'll try this too.
Aaron