C# 生成.wmv文件零字节

C# 生成.wmv文件零字节,c#,powerpoint,C#,Powerpoint,大家好,这是我在C#中的代码,我读取了一个.ppptx文件并将其转换为.wmv,因为某种原因,它会生成一个零大小的文件。当我将其保存为gif时,它工作正常,但我找不到原因 using Microsoft.Office.Core; using Microsoft.Office.Interop.PowerPoint; using ppt = Microsoft.Office.Interop.PowerPoint; using System.Runtime.InteropServices; using

大家好,这是我在C#中的代码,我读取了一个.ppptx文件并将其转换为.wmv,因为某种原因,它会生成一个零大小的文件。当我将其保存为gif时,它工作正常,但我找不到原因

using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
using ppt = Microsoft.Office.Interop.PowerPoint;
using System.Runtime.InteropServices;
using System;

namespace PowerPoint
{
    class Program
    {
    static void Main(string[] args)
    {
        //{0} source path filename
        //{1} destination path
        var app = new ppt.Application();

       // ppt.Presentation file = app.Presentations.Open(args[0], MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);
        ppt.Presentation file = app.Presentations.Open(@"C:\Users\mkolozoff\Desktop\tutorial1.pptx", MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);

       // file.SaveCopyAs(args[1], PpSaveAsFileType.ppSaveAsWMV);
        file.SaveCopyAs(@"C:\Users\mkolozoff\Desktop\demo.wmv", PpSaveAsFileType.ppSaveAsWMV);

        file.Close();
        app.Quit();

        Marshal.ReleaseComObject(file);
        Marshal.ReleaseComObject(app);

        file = null;
        app = null;

        GC.Collect();
        GC.WaitForPendingFinalizers();

    }
}
}

PpSaveAsFileType.ppSaveAsWMV
是否存在?是的,我在编辑器中看到了。但是它没有在MSDN中列出:您可能想检查一下:好的,这真的很有帮助,非常感谢。但是我有一个问题。我使用远程桌面。当我在服务器中运行应用程序时(我连接到远程桌面)一切正常。当我构建应用程序并将其复制到我的pc时,我遇到一个异常。你知道我可能做错了什么吗?谢谢你的帮助!什么是
异常
?检查本地电脑上是否有所有参考资料,例如Microsoft.Office.Interop.PowerPoint