使用 UDF 发布 C# Excel 插件
publish C# Excel Addin with UDF
我在 C# 中开发 Excel 插件,当我发布 C# 插件时出现问题。
我来解释一下:
我使用了这个代码:http://csharpramblings.blogspot.fr/2011/09/communicating-between-vsto-and-udfs-in.html
这允许我在我的插件中使用 UDF。而且效果很好! ...在 Visual Studio 2013 年。
当我使用 Visual Studio 启动插件时,我在 Excel 中看到 "COM Addins" 中的插件。我的 UDF 在 Excel."Excel Addins".
那么如果:
我在 visual studio 的项目中通过右键单击发布了我的插件。
我使用 VS 生成的 setup.exe 安装插件。
我启动 Excel
=> 我的插件运行良好,但我的 UDF 不起作用。单元格的值为“#NAME?”。
我检查了 COM 加载项,我的加载项存在。
我检查了 Excel 插件,我没有看到我的 UDF。
所以我使用RegAsm 来注册已发布的DLL 的程序集。
现在我在 "Excel Addins" 中看到了我的 UDF,但它仍然不起作用。
如果有人有想法帮助我,那就太好了!
我使用:Windows 8.1 Pro,Visual Studio Pro 2013,Excel 2016 和 Office365
提前感谢您的宝贵时间。
我终于找到了解决办法!
我的错误是在没有任何参数的情况下使用了 Regasm。
现在,我将 Regasm 与 /codebase 参数一起使用,并使用强名称对我的程序集进行了签名。因为 Regasm 文档说:
Creates a Codebase entry in the registry. The Codebase entry specifies
the file path for an assembly that is not installed in the global
assembly cache. You should not specify this option if you will
subsequently install the assembly that you are registering into the
global assembly cache. The assemblyFile argument that you specify with
the /codebase option must be a strong-named assembly.
Source : https://msdn.microsoft.com/fr-fr/library/tzat5yw6(v=vs.110).aspx
现在我在 Excel 中看到了我的 UDF,它们可以正常工作。
我在 C# 中开发 Excel 插件,当我发布 C# 插件时出现问题。
我来解释一下:
我使用了这个代码:http://csharpramblings.blogspot.fr/2011/09/communicating-between-vsto-and-udfs-in.html
这允许我在我的插件中使用 UDF。而且效果很好! ...在 Visual Studio 2013 年。
当我使用 Visual Studio 启动插件时,我在 Excel 中看到 "COM Addins" 中的插件。我的 UDF 在 Excel."Excel Addins".
那么如果: 我在 visual studio 的项目中通过右键单击发布了我的插件。 我使用 VS 生成的 setup.exe 安装插件。 我启动 Excel => 我的插件运行良好,但我的 UDF 不起作用。单元格的值为“#NAME?”。
我检查了 COM 加载项,我的加载项存在。 我检查了 Excel 插件,我没有看到我的 UDF。
所以我使用RegAsm 来注册已发布的DLL 的程序集。 现在我在 "Excel Addins" 中看到了我的 UDF,但它仍然不起作用。
如果有人有想法帮助我,那就太好了!
我使用:Windows 8.1 Pro,Visual Studio Pro 2013,Excel 2016 和 Office365
提前感谢您的宝贵时间。
我终于找到了解决办法!
我的错误是在没有任何参数的情况下使用了 Regasm。 现在,我将 Regasm 与 /codebase 参数一起使用,并使用强名称对我的程序集进行了签名。因为 Regasm 文档说:
Creates a Codebase entry in the registry. The Codebase entry specifies the file path for an assembly that is not installed in the global assembly cache. You should not specify this option if you will subsequently install the assembly that you are registering into the global assembly cache. The assemblyFile argument that you specify with the /codebase option must be a strong-named assembly.
Source : https://msdn.microsoft.com/fr-fr/library/tzat5yw6(v=vs.110).aspx
现在我在 Excel 中看到了我的 UDF,它们可以正常工作。