找不到报表生成器自定义程序集中的方法
我正在尝试在 Report Builder 2.0 中使用自定义程序集。我已通过“报告属性”>“将程序集添加到报告中”参考。当我尝试在程序集中调用公共静态方法时,我收到以下消息:
“ExtractTag”不是“ReportsClassLibrary.ReportsClassLibraryTools”的成员。
我试图用来调用该方法的表达式是:
=ReportsClassLibrary.ReportsClassLibraryTools.ExtractTag("ID", "ID:incorrect", false)
程序集中的方法签名是:
public static string ExtractTag(string tagToFind, string tags, bool caseSensitive)
该方法位于 ReportsClassLibrary
命名空间和 ReportsClassLibraryTools
类中。
我不知道是否由于某种原因我的报告正在查找没有此方法的旧版本的程序集,或者问题是否是其他原因。我尝试从报告中删除程序集,重建程序集,然后将其重新添加到报告中。
编辑:看起来是一个更深层次的问题。我的程序集可以编译,但是当运行调用该方法的测试用例时,测试失败并出现 System.MissingMethodException。我猜我遇到了程序集问题,而不是报表生成器问题......
I'm trying to use a custom assembly in Report Builder 2.0. I have added the assembly to the report via Report Properties > References. When I try to call a public static method in the assembly, I get this message:
'ExtractTag' is not a member of 'ReportsClassLibrary.ReportsClassLibraryTools'.
The expression I'm trying to use to call the method is:
=ReportsClassLibrary.ReportsClassLibraryTools.ExtractTag("ID", "ID:incorrect", false)
And the method signature in the assembly is:
public static string ExtractTag(string tagToFind, string tags, bool caseSensitive)
That method is within the ReportsClassLibrary
namespace and in the ReportsClassLibraryTools
class.
I don't know if for some reason my report is looking an older version of the assembly that did not have this method, or if the problem is something else. I've tried removing the assembly from the report, rebuilding the assembly, and re-adding it to the report.
Edit: looks like a deeper problem. My assembly compiles, but when running a test case that calls that method, the test fails with a System.MissingMethodException. Guess I'm having an assembly problem, not a Report Builder problem...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果发现这是 Vista 中全局程序集缓存的问题。我的程序集的旧版本已缓存,因此新方法
ExtractTag
不是程序集的一部分。我不得不跑:Turned out it was a problem with the Global Assembly Cache in Vista. The old version of my assembly was cached, so the new method
ExtractTag
wasn't part of the assembly. I had to run: