System.Runtime.InteropServices.COMException:设备尚未就绪

时间:2015-07-30 09:56:04

标签: c# powerpoint office-interop

我在C#app中使用第三方库(DigitalOfficePro),它使用Microsoft Interop。此应用程序将powerpoint演示文稿转换为html文件 在当地环境中,这很好。在远程服务器上,我收到以下错误:

  

2015-07-30 11:46:00,584 [10] ERROR Mintra.Publisher.DocumentConverter.Core.Presentation.Conversion.HtmlConversion.Convert(:0)(null) - System.Exception:错误durign转换文件' \ VIRT-PUB-STAGIN \ converter_shared \ ppt \ Beerenberg_manual0_CellGlassCutting.ppt'输出位置'D:\ converter_shared \ converted \ ppt \ Beerenberg_manual0_CellGlassCutting'转发! ---> System.Runtime.InteropServices.COMException:设备尚未就绪。    ---> System.IO.IOException:设备尚未就绪。      在System.IO .__ Error.WinIOError(Int32 errorCode,String maybeFullPath)      在System.IO.Directory.InternalCreateDirectory(String fullPath,String path,Object dirSecurityObj,Boolean checkHost)      在System.IO.Directory.InternalCreateDirectoryHelper(String path,Boolean checkHost)      在System.IO.Directory.CreateDirectory(String path)      在DigitalOfficePro.Html5PointSdk.PresentationConverter.c1234c1700677d6aa7d432fdb965c78bb(String c7fc9d9edb8de5e2eb0df0a4b94c9b98d)      在DigitalOfficePro.Html5PointSdk.PresentationConverter.Convert(String outputFileNameWithPath)      ---内部异常堆栈跟踪结束---      在DigitalOfficePro.Html5PointSdk.PresentationConverter.Convert(String outputFileNameWithPath)      在Mintra.Publisher.DocumentConverter.Core.Presentation.Conversion.HtmlConversion.Convert(String pptInputFileName,String htmlOutputFileName)      ---内部异常堆栈跟踪结束---

知道可能是什么问题吗?

我的当地环境详情:
Windows 7旗舰版(64x)
Microsoft Office PowerPoint 2007
打开XML SDK V2.5

远程环境详情:
Windows Server 2008 R2(64x)
Microsoft PowerPoint 2010
打开XML SDK V2.5

1 个答案:

答案 0 :(得分:1)

对我而言,您的设备(逻辑驱动器)D:尚未就绪。

            var driveInfo = new DriveInfo("D"); // or "D:\"

            if (driveInfo.IsReady)
            {
                // do your stuff..
            }
            else
            {
                // loggin, show to the user or throw an exception..
            }