Server Error in '/COVID-19' Application.

Could not find a part of the path 'C:\inetpub\wwwroot\mun-guarda_pt_COVID-19\noticia\audio\1112-23032020190143.mp3'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\inetpub\wwwroot\mun-guarda_pt_COVID-19\noticia\audio\1112-23032020190143.mp3'.

Source Error:


Line 40:             var voiceProvider = new VoiceProvider(apiKey, isSSL);
Line 41:             var voice = voiceProvider.Speech<byte[]>(voiceParams);
Line 42:             System.IO.File.WriteAllBytes(fileName, voice);
Line 43:         }
Line 44:         return registo+".mp3";

Source File: c:\inetpub\wwwroot\CMG\WWW\COVID-19\noticia\default.aspx    Line: 42

Stack Trace:


[DirectoryNotFoundException: Could not find a part of the path 'C:\inetpub\wwwroot\mun-guarda_pt_COVID-19\noticia\audio\1112-23032020190143.mp3'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +373
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +738
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +68
   System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) +82
   System.IO.File.WriteAllBytes(String path, Byte[] bytes) +39
   ASP.noticia_default_aspx.voice(String texto, String ficheiro) in c:\inetpub\wwwroot\CMG\WWW\COVID-19\noticia\default.aspx:42
   ASP.noticia_default_aspx.noticia(String id) in c:\inetpub\wwwroot\CMG\WWW\COVID-19\noticia\default.aspx:97
   ASP.noticia_default_aspx.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\CMG\WWW\COVID-19\noticia\default.aspx:131
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0