-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Asp.Net Core MVC site with Microsoft.ReportViewer.2015.Runtime #4910
Comments
@mbharodia can you share your project.json file? |
Hi Elion, { "dependencies": { "tools": { "frameworks": { "buildOptions": { "publishOptions": { "scripts": { |
Just a further note on the error I am getting. Here is the full error message. Failed to load expression host assembly. Details: Type 'Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DataStoreErrorLogger+DataStoreErrorLog' in assembly 'Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' is not marked as serializable. at Microsoft.ReportingServices.RdlExpressions.ReportRuntime.ProcessLoadingExprHostException(ObjectType assemblyHolderObjectType, Exception e, ProcessingErrorCode errorCode) I am wondering why it is loading EntityFrameworkCore when I try to run LocalReport’s Render() method. I am sure I am missing something here. I think I am not looking for any logging at this moment at least. From: Eilon Lipton [mailto:notifications@github.com] @mbharodiahttps://github.com/mbharodia can you share your project.json file? — |
From: Eilon Lipton [mailto:notifications@github.com] @mbharodiahttps://github.com/mbharodia can you share your project.json file? — |
When I removed app.UseDatabaseErrorPage() from Configure() method in Startup I was able to run the report. Any idea why? Thanks a lot for looking into this. From: Eilon Lipton [mailto:notifications@github.com] @mbharodiahttps://github.com/mbharodia can you share your project.json file? — |
@mbharodia thanks for the detailed info! @pranavkm can you investigate? |
I tried generating a LocalReport with a Sql Server 2014 instance and it seemed to work fine (with or without the call to |
@mbharodia, have you had a chance to look at my repo as yet? |
I apologize if I am violating protocol by commenting on a closed thread but do not see a final resolution. I am experiencing the same problem, and resolution is the same - commenting out UseDatabaseErrorPage in Startup eliminates the error. Here's my code: [HttpPost]
private DataTable getData(string sqlView)
|
@rharmonjr - can you please open a new issue and give us a full description of the problem you have? |
Hi @mbharodia ! I'd to know if you could make works the Report Viewer with .Net Core !? |
The web app I migrated in 2016 targeted Asp.Net Core (full .Net framework 4.6.1 support). This web app has been upgraded to use Asp.Net Core 2.0. I believe that it works. However, please note that I am not using report viewer to show reports on the browser. The report viewer simply uses RDLC to generate a byte stream of PDF that can be downloaded using browser. Having said this, I am not sure whether it works for a web app that supports only .Net Core. I am also showing the template that I used from Visual studio to make things clear that it uses full .Net framework I added Microsoft.ReportViewer.2015.Runtime NuGet package to get required references for report viewer. You may try adding this reference to your web app and see if that works. |
Hi, I have the same issue with Microsoft.ReportViewer.2015.Runtime but in my case is related to nlog provider, Removing NLog.Extensions.Logging implementation all reports working normal |
Is anyone using subreports in their RDLC file? I was able to get the main report to render after removing the .UseNLog() option in Startup.cs, but the subreport won't load. This is the error I get in the rendered pdf report:
The subreport is in the same folder as the main report, and I even tried using the LocalReport.LoadSubreportDefinition method but get the same result. This works find in my older ASP.NET MVC project. |
I was able to resolve my issue with subreports by using a newer version of ReportViewer. The ReportViewer.2015.Runtime is version 12, but I needed to use Microsoft.ReportingServices.ReportViewerControl.WebForms, which is version 14. So, I still have the issue with NLog. Has anyone figured out how to get these 2 to work together? Anyone try upgrading to the latest beta of .NET Core? |
I just tried this again with .Net Core 2.1 and still get the same error if I enable Nlog in Startup.cs:
|
+1 here with the same error. Btw, here's the complete stack: Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Failed to load expression host assembly. Details: Type 'Microsoft.AspNetCore.Mvc.Internal.MvcCoreLoggerExtensions+ActionLogScope' in assembly 'Microsoft.AspNetCore.Mvc.Core, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' is not marked as serializable. Not sure on how this got closed with any sort of explanation.... |
NLog.Extensions.Logging ver. 1.2.1 has been released that improves support for BeginScope across AppDomain-boundary. See also NLog/NLog.Extensions.Logging#232 Please update to make RDLC work together with AspNetCore and NLog. |
|
Hi,
I was porting my web site written in older MVC to Asp.Net Core MVC. I have a report using RDLC. That runs fine on older site but throws the following error on core MVC.
Failed to load expression host assembly. The source of error is Microsoft.ReportViewer.WebForms.
An exception of type 'Microsoft.Reporting.WebForms.LocalProcessingException' occurred in Microsoft.ReportViewer.WebForms.dll but was not handled in user code
I think it might have to do with some sort of security or permission while running the required DLLs for the report viewer. I have added Microsoft.ReportViewer.2015.Runtime package and it uses Microsoft.ReportViewer.Common.dll, Microsoft.ReportViewer.ProcessingObject.dll and Microsoft.ReportViewer.WebForms.dll.
Please also note that I am trying to generate a byte stream of pdf file using LocalReport's Render method. I have also tried adding the following attributes to the method responsible to call the above render call and generate a byte stream.
[FileIOPermissionAttribute(SecurityAction.Assert, Unrestricted = true)]
[SecurityPermission( SecurityAction.Assert, Unrestricted = true)]
The old and new MVC sites both target full .Net framework 4.6.1. The reportviewer runtime works with the older site but not with newer. The older site doe not need any security permission or attribute as mentioned above. Is there any recommendation on how to use runtime with Asp.Net Core MVC targeting full .Net framework 4.6.1?
The text was updated successfully, but these errors were encountered: