添加WinRT组件的引用时出错 [英] Error when adding reference of WinRT component

查看:122
本文介绍了添加WinRT组件的引用时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自"媒体插件样本"示例文件,我将dll和.winmd文件放在项目的同一文件夹中并尝试插件。当我添加引用时,它有错误。我想知道dll的项目应该是与项目相同的解决方案尝试
参考吗?或者在添加引用时我想念一些东西?或者我需要创建自己的扩展SDK ??

From "Media plugins sample" sample file, I put the dll and .winmd file in the same folder of project and try to plugin. When I adding reference, it has error. I am wondering that does the project of dll should be the same solution with the project try the reference it?? Or I miss something when adding reference?? Or I need to create my own extension SDK??

推荐答案

我想你忘了在清单中注册组件。 (需要直接通过文本编辑器打开。)

I guess you forget to register you components in manifest. (Needs to open by text editor directly.)

这里是以下步骤:

 步骤1: 注册dll package.appxmanifest文件的扩展部分

<扩展>

    < Extension Category =" windows.activatableClass.inProcessServer">

      < InProcessServer>

        <路径> SSMFPluginM.dll< /路径>

        < ActivatableClass ActivatableClassId =" Microsoft.IIS.SSMFByteStreamHandler"的ThreadingModel = QUOT;二者" />
$
      < / InProcessServer>

    < / Extension>

< / Extensions>

 Step 1:  Register the dll in the extensions section of the package.appxmanifest file
<Extensions>
    <Extension Category="windows.activatableClass.inProcessServer">
      <InProcessServer>
        <Path>SSMFPluginM.dll</Path>
        <ActivatableClass ActivatableClassId="Microsoft.IIS.SSMFByteStreamHandler" ThreadingModel="both" />
      </InProcessServer>
    </Extension>
</Extensions>

第2步:在您的应用中,注册BSH以获取特定分机/ mime-type

var plugins = new Windows.Media.MediaExtensionManager();

try {

    //注册自定义ByteStreamHandler

    plugins.registerByteStreamHandler(" Microsoft.IIS.SSMFByteStreamHandler"," .ism"," text / xml");

}

catch(e){

    log(e.message);

}

Step 2:  In your app, register the BSH for a certain extension/mime-type
var plugins = new Windows.Media.MediaExtensionManager();
try {
    // Register custom ByteStreamHandler
    plugins.registerByteStreamHandler("Microsoft.IIS.SSMFByteStreamHandler", ".ism", "text/xml");
}
catch (e) {
    log(e.message);
}



您可以查看Media Plugins Sample以获取更多详细信息。

http://code.msdn.microsoft.com/windowsapps / Media-Plugins-Sample-8913a7e9

 

Eric


这篇关于添加WinRT组件的引用时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆