lkosson / reportviewercore

Recompilation of Microsoft.ReportViewer for .NET Core 3.1+
427 stars 123 forks source link

Missing Microsoft.ReportViewer.NETCore.XmlSerializers assembly issue when running in .net 7. #167

Closed 3grkt closed 10 months ago

3grkt commented 11 months ago

I've updated ReportViewerCore.NETCore to the latest version (15.1.19) but still having the error when setting the parameters (report.SetParameters). And I don't find XmlSerializers in the repo. System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.ReportViewer.NETCore.XmlSerializers, Version=15.1.19.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL'. The system cannot find the file specified.'

Would you please advise what should be the issue here?

lkosson commented 11 months ago

I don't recall there ever being Microsoft.ReportViewer.NETCore.XmlSerializers assembly in either this or original report viewer. Why did you reference such assembly?

3grkt commented 11 months ago

Thank you for looking at this. I didn't reference to the assembly explicitly. I'm just getting this exception when it gets to SetParameters() method in consuming the report services. ServerReport serverReport = new ServerReport(); serverReport.ReportServerUrl = new Uri(reportServer.Uri); serverReport.ReportPath = resourcePath; //exception happens at the below method. serverReport.SetParameters(new List() { new ReportParameter("ServerName", dataSource.ServerName), new ReportParameter("DatabaseName", dataSource.DatabaseName) }); return new MemoryStream(serverReport.Render("Pdf"));

lkosson commented 11 months ago

Oh, that one. It's related to webservices used to communicate with Reporting Service. You should be able to continue past this exception - it is caught and handled internally by .NET WSDL client.

3grkt commented 10 months ago

Thank you for your help. There were some issues along with that, but you are right that when I was debugging, it threw that exception but when I kept going for 3-4 times, it was getting through. Thanks again.