-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnetcore 3.0 #92
Comments
I am using this open source, but how that you say, in net core 3.0 release, give me an error at load report, System.MissingMethodException: Method not found: 'Microsoft.AspNetCore.Mvc.JsonResult Microsoft.AspNetCore.Mvc.Controller.Json. |
In .NET Core 3.0, I had to change the ViewReportPage() method. ReportController.cs / ViewReportPage(): |
Facing the same problem as written by Edilber. |
This issue reported by @usamabadr is caused by the fact that Newtonsoft.Json is no longer included in the .NET Core 3.x framework.. Core apps now use System.Text.Json by default. There are two solutions, one involves modifying the ReportController from Alan's code as @martinvaler pointed out, and the other involves including a package reference and modifying your startup to instruct MVC to use Newtonsoft JSON. Option #1: To reiterate @martinvaler's solution, in MvcReportViewer/ReportController/ViewReportPage method, completely replace the following code
with...
Option #2: First add a package reference to your .csproj file for your project in the ItemGroup that contains your other package references...
Then, in your Startup.cs/ConfigureServices method, instruct MVC to use Newtonsoft JSON...
This is compatible with all new MVC service registration methods as well (AddControllers, AddControllersWithViews, AddRazorPages) if you have switched over to the more granular methods along with endpoint routing... I just used the most common example here Personally, I prefer option #1 to let .NET Core use it's new System.Text.Json package. As far as the issue reported by @Edilber I never encountered that, but the class and method you reference still exist in .NET Core 3.x, so I would assume that the package reference that includes them is not being picked up somehow, which is in the Microsoft.AspNetCore.Mvc namespace and is already a using directive in the ReportController. Realize that if your project file is referencing
then the metapackage Microsoft.AspNetCore.App is implicitly included which includes the entire .NET Core standard framework, however, if your project references something else, like...
then you must explicitly include the metapackage in your project file with...
Sorry, can't be of much more help without knowing where and when this error is occurring for you |
I'm running into the same issue as @Edilber. Could it be because in dotnetcore 3.0 the Controller.Json changed from Json(Object, JsonSerializerSettings) to Json(Object, Object)? |
Hi, I had changed follow code for resolve my problem:
Method of ReportController.cs, AlanJuden Project. In my Startup.cs file, I put the follow configuration:
int the public void ConfigureServices(IServiceCollection services) Method. I hope that help you @thoseposers I have changed the design too, because it was in boostrap 3, but now I change to Boostrap 4. |
@Edilber |
@justindbaur In this file you can find this design Boostrap4. |
@Edilber Hi, I am trying to port this to bootstrap 4 and I am getting a method not found error on the following "SetParameters" line. Any thoughts? |
What is the file where you are getting this error? You must have all project of AlanJuden, only replace the file CoreHtmlHelpers.cs |
Have also had this problem while trying to upgrade from .net core 2.1 to 5.0 and eventually solved it in a different way. Hope this helps someone else. |
thanks its resolve but now im getting another exception related to jsonresult . |
@rinkayadav |
Thank u for your suggestion and help now its working fine . |
@rinkayadav You must change the result type of ViewReportPage method in ReportController.cs from AlanJuden's Project to: var jsonResult = Json( new { CurrentPage = contentData.CurrentPage, Content = content, TotalPages = contentData.TotalPages }. return jsonResult; Greetings!! |
the code runs well on netcore 2.2 but on netcore 3.0 RC1 gives check report parameters
The text was updated successfully, but these errors were encountered: