0

我正在尝试编译一个用 C# 开发的 excel 插件解决方案。编译时一切顺利,但最后,我收到以下消息:

错误 1 ​​无法注册程序集“C:\Users\bandrade\HTBase\Programs\Palo\HTOSE\HTOSE\2.5\XlAddin\bin\Debug\Jedox.Palo.XlAddin.dll”。无法加载文件或程序集“Jedox.Palo.Comm.dll”或其依赖项之一。指定的模块无法找到。C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 3341

有没有人有任何想法?

我做的一个测试是,如果我取消选中“Register for COM interop”,它编译得很好,这个错误消失了,但是 Excel 无法识别 .dll,我收到以下错误消息:

“.dll 不是有效的 Excel 插件”

如何在不取消选中“注册 COM 互操作”的情况下成功编译它?

这是提示错误的例程:

Registers the main assembly for COM interop.
============================================================
-->
<PropertyGroup>
    <UnmanagedRegistrationDependsOn></UnmanagedRegistrationDependsOn>
</PropertyGroup>
<Target
    Name="UnmanagedRegistration"
    Condition="'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'"
    DependsOnTargets="$(UnmanagedRegistrationDependsOn)"
    >

    <RegisterAssembly
        Assemblies="@(_OutputPathItem->'%(FullPath)$(TargetFileName)')"
        TypeLibFiles="@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')"
        AssemblyListFile="@(_UnmanagedRegistrationCache)"
        CreateCodeBase="true"
        Condition="!Exists('@(_UnmanagedRegistrationCache)')"/>

    <ItemGroup>
        <FileWrites Include="@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')"/>
    </ItemGroup>
</Target>

提前致谢

4

0 回答 0