c# - Diagnostic display apear on open the add-in
问题描述
We have the add-in to excel written in C#. We are using Excel-DNA also. Lately we got this window on startup of Add-in
Any idea what is this window and how we can turn of it?
解决方案
By default, Excel-DNA will try to register all public static
methods in public types in the assemblies listed as <ExternalLibrary ...>
in the .dna file.
For your add-in, there seems to be more than one such function called 'Modulus' that Excel-DNA is trying to register. The error arises from this duplication (one registration is being overwritten by another).
You have a few ways around this:
- Make sure you only have one 'Modulus' function being registered, either by making one of the methods not public, or enabling 'ExplictExports=true' in your .dna file and marking all functions with
ExcelFunction
attributes. - Make sure you don't have additional libraries set up as
<ExternalLibrary>
in the .dna file - extra assemblies that you want to pack into a single-file .xll should be added as<Reference>
tags - these are not examined for functions and registered with Excel. - You can control how the logging works, and thus prevent the error window from showing, by customising the logging settings in the .xll.config file - see https://github.com/Excel-DNA/ExcelDna/wiki/Diagnostic-Logging.
推荐阅读
- python-3.x - 如何使用 DAG 代码中的不可安装模块?
- python - pandas 使用记录的权重和列名的值分组加权平均值
- javascript - 在滚动上绘制曲线虚线 SVG 路径
- python - 如何通过 mqtt 接收来自多个客户端的消息?
- java - 如何使用 Spring WebClient 直接写入 Http OutputStream?
- python - 弹出错误:需要类似字节的对象,而不是“str”
- sql - SQL 运行总秒数 - 时间戳/值
- spring-integration - 使用 Spring Boot 2 启用 MessageHistory 时无法发送 kafka 消息
- sinon - 我可以使用带有 sinon.assert.callWith 的自定义匹配器吗?
- ckeditor - 第一次提交时未提交 CKEDITOR 字段中的文本