使用Microsoft报表查看器时,Postsharp会导致错误

时间:2022-07-11 08:17:06

in my project I use two different versions of MicrosoftReportViewer (Version 9 and 10) and declare them by extern alias.

在我的项目中,我使用两个不同版本的MicrosoftReportViewer(版本9和10)并通过extern别名声明它们。

It seems like PostSharp causes a problem at compiletime that leads to an error at runtime.

看起来PostSharp在编译时导致问题,导致运行时出错。

Here is the error when I try to show a report:

我尝试显示报告时出现以下错误:

Method not found: "Microsoft.Reporting.WebForms.ReportDataSourceCollection Microsoft.Reporting.WebForms.LocalReport.get_DataSources()".

找不到方法:“Microsoft.Reporting.WebForms.ReportDataSourceCollection Microsoft.Reporting.WebForms.LocalReport.get_DataSources()”。

If I deactivate PostSharp for runtime, the error is still there but if I deactivate PostSharp at all, so even for compiling, the report works fine.

如果我为运行时停用PostSharp,则错误仍然存​​在,但如果我完全停用PostSharp,那么即使编译,报告也能正常工作。

Here is how I apply my aspects:

以下是我如何应用我的方面:

[assembly: ClickLogger("Click Events", AttributeTargetMembers = "*Click", AttributePriority = 1)]
[assembly: ParamValueChangedLogger("Value changed events", AttributeTargetMembers = "*ValueChanged", AttributePriority = 1)]
[assembly: ParamValueChangedLogger("Value changed events", AttributeTargetMembers = "*CellValueChanged", AttributeExclude = true, AttributePriority = 2)]
[assembly: CellValueChangedLogger("Cell value changed events", AttributeTargetMembers = "*CellValueChanged", AttributePriority = 1)]
[assembly: DataAdapterLogger("Data Adapter call events", AttributeTargetTypes = "*.Data*", AttributeTargetMembers = "get_Adapter", AttributePriority = 1)]
[assembly: DataAdapterLogger("Data Adapter call events", AttributeTargetMembers = "SaveToDB", AttributeExclude = true, AttributePriority = 2)]

Anyone ever had this error or an idea what to do here?

任何人有过这样的错误或想法在这做什么?

If you need further information feel free to ask.

如果您需要更多信息,请随时询问。

Thanks in advance for your time and help.

在此先感谢您的时间和帮助。

1 个解决方案

#1


0  

This is likely a bug of PostSharp. The best thing to do is to report it to http://www.sharpcrafters.com/forum and attach a simple project reproducing the issue.

这可能是PostSharp的一个错误。最好的办法是将其报告给http://www.sharpcrafters.com/forum并附上一个简单的项目来重现这个问题。

#1


0  

This is likely a bug of PostSharp. The best thing to do is to report it to http://www.sharpcrafters.com/forum and attach a simple project reproducing the issue.

这可能是PostSharp的一个错误。最好的办法是将其报告给http://www.sharpcrafters.com/forum并附上一个简单的项目来重现这个问题。