alanjuden / MvcReportViewer

Custom Report Viewer control to replace MS Report Viewer on MVC projects (also works on .NET Core as a Report Viewer).
MIT License
173 stars 108 forks source link

System.ServiceModel.Http not found with dotnetcore 2.0 #43

Open ctrl-brk opened 6 years ago

ctrl-brk commented 6 years ago

After upgrading my project from 1.1 to core 2.0 getting the following error when serving under IIS. Never had this in 1.1.

System.IO.FileNotFoundException: Could not load file or assembly 'System.ServiceModel.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.ServiceModel.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](Assembly element)
   at Microsoft.AspNetCore.Mvc.Razor.Compilation.ViewsFeatureProvider.GetViewAttributes(AssemblyPart assemblyPart)
   at Microsoft.AspNetCore.Mvc.Razor.Compilation.ViewsFeatureProvider.PopulateFeature(IEnumerable`1 parts, ViewsFeature feature)
   at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider.GetViewDescriptors(ApplicationPartManager applicationManager)
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider.EnsureCache()
   at Microsoft.AspNetCore.Mvc.RazorPages.Internal.CompiledPageRouteModelProvider.OnProvidersExecuting(PageRouteModelProviderContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionDescriptorProvider.BuildModel()
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.UpdateCollection()
   at Microsoft.AspNetCore.Mvc.Internal.ActionDescriptorCollectionProvider.get_ActionDescriptors()
   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.GetTreeRouter()
   at Microsoft.AspNetCore.Mvc.Internal.AttributeRoute.RouteAsync(RouteContext context)
   at Microsoft.AspNetCore.Routing.RouteCollection.<RouteAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Zenith.Web.Middleware.UserTokenMiddleware.<Invoke>d__3.MoveNext() in C:\Projects\Client Data Management\Test\Zenith\Zenith.Web\Middleware\UserTokenMiddleware.cs:line 46
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Zenith.Web.Startup.<>c.<<Configure>b__10_0>d.MoveNext() in C:\Projects\Client Data Management\Test\Zenith\Zenith.Web\Startup.cs:line 87
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()
cgountanis commented 6 years ago

I get the same thing, plopped the controller and view, edit the settings in controller and same error. Is this a Core 2 issue?

alanjuden commented 6 years ago

@cgountanis & @ctrl-brk,

I don't use the .NetCore version as my daily driver (only created it to help the community and get my hands into NetCore). I'll have to try upgrading my project and see if I run into the same issue or not. I'm also not sure what upgrading would do to all the people running on the version 1.1 framework and using my library. I'll have to do some testing on this. Sorry I can't be more help at the moment.

Alan

cgountanis commented 6 years ago

This is really the only thing I still need to make Core2/SSRS work for us. Core2 has everything else working for itself these days. I guess I could plop a ASPX page in my MVC application if I have to :(

Eventually the Core/SSRS team will get on the ball with WebForms going away in the future. They kind of have to, aye?

Here for testing if needed.

ctrl-brk commented 6 years ago

For now I got rid of nuget package and building viewer from source. Updated to use dotnetstandard2.0, updated to use latest microsoft/http packages. And it's working for me as a temp fix.

k11k2 commented 6 years ago

Install System.ServiceModel.Http package.

k11k2 commented 6 years ago

@ctrl-brk running successful ? did you made any changes for existing one ? cause I'm facing trouble to retrieve reports as mentioned here ISSUES

ctrl-brk commented 6 years ago

@AlwaysAbhl001 works just fine. Didn't make any changes to the code. Only upgraded to latest packages/dotnetstandard

cgountanis commented 6 years ago

I was able to get it to work @ctrl-brk but it was a bit more than just changing the class lib to 2.0, not much though, had to play with the NUGET packages manually a bit and remove properties from the class lib.

wsrinivas commented 6 years ago

Hi All

a request from a newbie, Can you please create some instructions as to how I can run SSRS reports in my new .Net Core 2.0 application. Been searching for a few days now.

cgountanis commented 6 years ago

Anyone have issues with auth once hosted on IIS?

https://stackoverflow.com/questions/47416234/core-2-mvc-wcf-to-ssrs-execution-project-needs-administrator-iis-apppool-to-wo

oleksandrnechaiev commented 5 years ago

@cgountanis Hello, could you share how did you migrate from .net standart 1.6 na .netstandart 2 because my main project in .net core2 and this library not compatible with this nuget( I will be really grateful for an answer.

cgountanis commented 5 years ago

https://github.com/alanjuden/MvcReportViewer/issues/43#issuecomment-468397096

I did not update the project I ended up making my own report service that just spits out downloadable files which works for multiple devices much better than trying to get some kind of responsive preview report window.

oleksandrnechaiev commented 5 years ago

@cgountanis how did you do this "spits out downloadable files" ?) can you concise describe workflow)

cgountanis commented 5 years ago

Using the SSRS services the ASMX directly which this project has examples for. It has the ability to spit out word excel CSV and PDF files directly as binary. Then you just serve the files to the browser no preview. The only complex part is making sure you add parameters to the report services before you execute and get the file so you get the data that you expect.

oleksandrnechaiev commented 5 years ago

i see, but if i need an interactivereport (with the controls panel) i can't get it in that way, right ? Thank you for sharing=)

cgountanis commented 5 years ago

Correct that is just a report that is generated for example as a PDF directly with or without parameters. There is no preview or interactivity which actually works great for mobile phones and tablets with small screens. Good luck! might want to look into azure and power bi seems like that's where everything is going.

oleksandrnechaiev commented 5 years ago

@cgountanis , thank You very much=)