C# 使用ClickOnce应用程序部署COM组件

C# 使用ClickOnce应用程序部署COM组件,c#,com,clickonce,C#,Com,Clickonce,我们正在开发一个C#WPF(.NET4.0)应用程序,它需要屏幕“录制”。我们已经评估了ByteScout的(免费试用),它正是我们所需要的 然而,问题在于,我们的应用程序被设计为通过ClickOnce部署到我们客户的机器(不在我们的网络上),并且可能会以有限的非管理用户身份登录。SDK有一个可再发行的组件,但这需要单独安装-这对ClickOnce没有好处 Bytes似乎无法在“免注册部署”一节的文档中满足这一需求: 因此:我创建了一个app.manifest文件-我的项目以前没有或需要它-并从

我们正在开发一个C#WPF(.NET4.0)应用程序,它需要屏幕“录制”。我们已经评估了ByteScout的(免费试用),它正是我们所需要的

然而,问题在于,我们的应用程序被设计为通过ClickOnce部署到我们客户的机器(不在我们的网络上),并且可能会以有限的非管理用户身份登录。SDK有一个可再发行的组件,但这需要单独安装-这对ClickOnce没有好处

Bytes似乎无法在“免注册部署”一节的文档中满足这一需求:

因此:我创建了一个
app.manifest
文件-我的项目以前没有或需要它-并从上面提到的SAMPLE.EXE.manifest中添加了以下内容:

<file name="BytescoutScreenCapturing.dll">
    <comClass
        description="Capturer Class"
        clsid="{48967118-C4C9-435C-94D8-001247B9A52A}"
        threadingModel="Apartment"
        progid="BytescoutScreenCapturing.Capturer"
        tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}" />
    <comClass
        description="C:\Documents and Settings\Administrator\My Documents\Capture From Entire Screen\bin\Debug\BytescoutScreenCapturing.dll"
        clsid="{DCAFCA37-546E-4D0A-9C02-D3221E65FCA9}"
        threadingModel="Both" />

    <typelib tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}"
        version="1.0"
        helpdir="C:\Documents and Settings\Administrator\My Documents\Capture From Entire Screen\bin\Debug\" />

</file>

<comInterfaceExternalProxyStub
    name="ICapturer"
    iid="{DCAFCA37-546E-4D0A-9C02-D3221E65FCA9}"
    proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
    baseInterface="{00000000-0000-0000-C000-000000000046}"
    tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}" />

<comInterfaceExternalProxyStub
    name="IVideoWMVSettings"
    iid="{1A814EC2-55A9-4FA2-99E2-2C20A897C2E7}"
    proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
    baseInterface="{00000000-0000-0000-C000-000000000046}"
    tlbid="{8EDAD3BB-AE5F-43B4-A2F1-B04F4130F2E0}" />

<file name="BytescoutScreenCapturingFilter.dll">

    <comClass
        description="Bytescout Screen Capturing Filter"
        clsid="{0F5D4CE4-2166-4FF7-9AA1-91330D35978A}"
        threadingModel="Both" />

    <comClass
        description="Screen Capturing Property Page"
        clsid="{22DD33B0-30C4-420D-A955-844E2B85A1F3}"
        threadingModel="Both" />

    <comClass
        description="Screen Capturing Property Page"
        clsid="{9D153AAA-0477-4C2E-B827-211F10561B44}"
        threadingModel="Both" />

    <comClass
        description="Screen Capturing Property Page"
        clsid="{26882CF7-F62F-47DB-9A3C-D1191591BD04}"
        threadingModel="Both" />

</file>

<file name="BytescoutVideoMixerFilter.dll">

    <comClass
        description="Bytescout Video Mixer Filter"
        clsid="{4407F28D-97C2-41C5-A23F-2FAE465CE7BB}"
        threadingModel="Both" />

</file>
Bytescout也有一个示例控制台应用程序,我对此也有同样的问题:项目构建良好,但由于上述错误而失败。我已经尝试与他们的支持接触,但除了“尝试阅读文档”之外,我没有得到太多的回应

我尝试过“自注册”COM组件;我对COM没有太多(或者确实没有)经验,但是我尝试过的所有示例代码(A)和(B)在没有管理权限的情况下或者(C)两者都不起作用。我不确定这在我的场景中是否可行

有人能就如何进行提出建议吗?我们所需要的是DLL被“注册”并可在我的代码中使用,而无需安装它们

编辑:如果我编辑生成的
myapp.exe.Manifest
文件,并将“resourceID”设置为“1”,则会出现进一步的错误:

Activation context generation failed for "myapp.exe.Manifest".
Error in manifest or policy file "myapp.exe.Manifest" on line 103. The value "" of attribute "tlbid" in element "comClass" is invalid.
如果我从项目中删除
app.manifest
文件,并将引用DLL上的
隔离设置设置设置为
True
,则启动时的错误更改为:

Activation context generation failed for "myapp.exe.Manifest".
 Dll redirector contributor unable to add file map entry for file BytescoutScreenCapturing.dll; Two or more components referenced directly or indirectly by the application manifest have files by the same name.

黑暗中的总镜头--尝试向typelib元素添加resourceid属性。相信它应该是一个int值。@dbugger:知道什么值吗?不,试试0或1,看看会发生什么。@NETscape:很遗憾,我没有访问COM项目本身的权限,只有可再发行的DLL。不客气。不需要再加上一个答案——你完成了工作。
Activation context generation failed for "myapp.exe.Manifest".
Error in manifest or policy file "myapp.exe.Manifest" on line 103. The value "" of attribute "tlbid" in element "comClass" is invalid.
Activation context generation failed for "myapp.exe.Manifest".
 Dll redirector contributor unable to add file map entry for file BytescoutScreenCapturing.dll; Two or more components referenced directly or indirectly by the application manifest have files by the same name.