Exception on IIS Server When try to create .wav file on c# using SpeechSynthesizer.
相关问题
- How to make a .svc file write to asp.net Trace.axd
- How to deploy python flask application in conda ba
- ASP.NET won't compile to debug
- Web server farms with IIS ? Basic Infos [closed]
- how do i manually configure a virtual directory in
相关文章
- 请教IIS URL重定向的问题
- 一个愚昧的问题,在一台电脑/云服务器下,假设某个系统访问量大,给他在IIS部署多个同样的网站和部署一
- .Net5 程序发布到IIS10
- 程序是如何接收并启动监听 IIS 站点设置的端口号的?
- IIS App Pools & Static Classes
- ASP.NET code to detect whether IIS “Windows Authen
- Installing Web Deploy on IIS 7+ with Shared Config
- ASP.NET is not authorized to access the requested
This error is caused when the application is unable to access a voice for the SpeechSynthesizer to use. The first possible cause is the lack of any installed voices on the system. Odds are this isn't the problem, but you should still double check by running something like the following bit of code:
Assuming the above returns a number higher than 0, the problem is likely a more complicated issue with your application's security settings.
Several methods in the SpeechSynthesizer class, including SetOutputToWaveFile, require the immediate caller to be fully trusted. This might not be a huge concern for a desktop application (which the SpeechSynthesizer class was likely designed for) but has more serious security repercussions in a web environment. Therefore, IIS's default settings only make applications partially trusted. There are a number of ways to change this, possibly the quickest and certainly the dirtiest way is switching the application pool's identity from the default to an account with administrator privileges like the LocalSystem account.
Once again, just for emphasis, this will seriously harm the security of your application and should be fully researched before implementing.
Simply, run the app as "administrator". ;)
Simple fix: Grant read/write access to
C:\windows\system32\config\systemprofile\appdata\roaming
for the same user that the app pool is running under.