简体   繁体   English

未在MS Server 2003 64位的ASP.NET中创建Windows Media编码器对象

[英]Windows Media Encoder object not created in ASP.NET on MS Server 2003 64 bit

I created (and used) a Windows Media Encoder object in Microsoft Visual C# 2008 Express Edition on MS Server 2003 64 bit. 我在MS Server 2003 64位的Microsoft Visual C#2008 Express Edition中创建(并使用)了Windows Media编码器对象。 This worked fine. 这很好。

However, when I attempted to create the equivalent Windows Media Encoder object using Microsoft Visual Web Developer 2008 on MS Server 2003 64 bit, the following exception was thrown: 但是,当我尝试在MS Server 2003 64位上使用Microsoft Visual Web Developer 2008创建等效的Windows Media编码器对象时,引发了以下异常:

"Retrieving the COM class factory for component with CLSID {632B606A-BBC6-11D2-A329-006097C4E476} failed due to the following error: 80040154." “由于以下错误,检索具有CLSID {632B606A-BBC6-11D2-A329-006097C4E476}的组件的COM类工厂失败:80040154。”

It cannot be that the component isn't registered, because both have a reference to the same WMEncEng.dll file. 不可能是未注册组件,因为两者都引用了相同的WMEncEng.dll文件。 The Microsoft Visual Web Developer 2008 code also worked fine on XP 32 bit. Microsoft Visual Web Developer 2008代码在XP 32位上也可以正常工作。

Could it be a problem with permissions? 权限可能有问题吗? Regardless, anyone have any ideas why this problem is occurring and, more importantly, how to resolve it? 无论如何,任何人都知道为什么会发生此问题,更重要的是,如何解决它?

Thank you. 谢谢。

Here are the two code snippets from MS Server 2003 64 bit: 这是MS Server 2003 64位的两个代码段:

Microsoft Visual Web Developer 2008 (did not work): Microsoft Visual Web Developer 2008(无效):

using System;
using WMEncoderLib;

namespace TestWMEnc
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                WMEncoder encoder = new WMEncoder(); //exception thrown
                // ...

            }
            catch (Exception err)
            {
                string exception = err.Message;
            }

        }
    }
}

Microsoft Visual C# 2008 Express Edition (worked fine): Microsoft Visual C#2008 Express Edition(工作正常):

using System;
using System.Windows.Forms;
using WMEncoderLib;

namespace testWMEncoder
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                WMEncoder encoder = new WMEncoder();
                // ...

            }
            catch (Exception err)
            {
                string exception = err.Message;
            }

        }
    }
}

I get this error at "WMEncoder encoder = new WMEncoder();" 我在“ WMEncoder编码器= new WMEncoder();”处收到此错误。 with code compiled for a x86 target but running on a x64 system. 使用为x86目标编译但在x64系统上运行的代码。 Try to set the target system in VWD to "Any CPU" if possible. 如果可能,尝试将VWD中的目标系统设置为“任何CPU”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM