Comments (12)
Indeed in RSParams
control (and some other in WinForms
project) there are some indirect references to BinaryFormatter
which I have missed.
from reportviewercore.
BinaryFormatter
is indeed disabled by default in AspNetCore 5.0. As a workaround, please add <EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
to your csproj while I explore whether it is possible to replace ResX binary formatted resources with something else.
from reportviewercore.
I have decided to remove those resources altogether. No need for EnableUnsafeBinaryFormatterSerialization
workaround - updated NuGet package coming in a minute.
from reportviewercore.
Hi, PDF working in last release on Linux?
from reportviewercore.
Hello. No, on Linux only available exporters are HTML4.0, HTML5, EXCELOPENXML and WORDOPENXML.
from reportviewercore.
Was this problem actually fixed? I see this issue is closed, but I'm experiencing this with the latest version (15.1.17).
Fortunately the workaround works so it's not really a problem, but I'm confused on whether I'm missing something since the issue is marked as closed...
from reportviewercore.
It should work without a workaround. If you still get System.NotSupportedException
mentioning BinaryFormatter
, please post a full stack trace here.
from reportviewercore.
Thanks for your quick reply, here's the stack trace:
System.NotSupportedException
HResult=0x80131515
Message=BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.
Source=System.Runtime.Serialization.Formatters
StackTrace:
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.Resources.Extensions.DeserializingResourceReader.ReadBinaryFormattedObject()
at System.Resources.Extensions.DeserializingResourceReader.DeserializeObject(Int32 typeIndex)
at System.Resources.Extensions.DeserializingResourceReader._LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.Extensions.DeserializingResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.Extensions.DeserializingResourceReader.ResourceEnumerator.get_Entry()
at System.Resources.Extensions.DeserializingResourceReader.ResourceEnumerator.get_Current()
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.ApplyResources(Object value, String objectName, CultureInfo culture)
at Microsoft.Reporting.WinForms.RSParams.InitializeComponent()
at Microsoft.Reporting.WinForms.RSParams..ctor()
at Microsoft.Reporting.WinForms.ReportViewer.InitializeComponent()
at Microsoft.Reporting.WinForms.ReportViewer..ctor()
It happens when I do new ReportViewer()
(running on .NET 6)
from reportviewercore.
I can confirm the fix is working - and am currently running 15.1.16 on .net 6.
But I do not instantiate a ReportViewer, but a LocalReport object from the Microsoft.Reporting.NETCore namespace...
from reportviewercore.
@tarockx Can you reproduce the behavior using ReportViewerCore.Sample.WinForms
project from this repo? When I switched it to .NET 6, the component initializes correctly without the workaround.
from reportviewercore.
@tarockx Can you reproduce the behavior using
ReportViewerCore.Sample.WinForms
project from this repo? When I switched it to .NET 6, the component initializes correctly without the workaround.
Sorry for the late reply.
I can confirm that @jkrebsbach is correct, if I don't use the ReportViewer
but use LocalReport
instead I don't have the issue, so I removed the WinForms assembly entirely and only use the LocalReport instead. Thanks for your support.
from reportviewercore.
@tarockx Can you reproduce the behavior using
ReportViewerCore.Sample.WinForms
project from this repo? When I switched it to .NET 6, the component initializes correctly without the workaround.
Hi @lkosson! In my app when targeting net8.0-windows (.NET 8) it throws BinaryFormatter exception on instantiation (in constructor) - new Microsoft.Reporting.WinForms.ReportViewer(). None of the workarrounds work. When I switch back to net7.0-windows ReportViewer works fine. Do you know what could be the cause? Compile time is OK but instantiation fails ...
EDIT 2
The issue can be reproduced in sample WinForms project - it throws System.NotSupportedException: 'BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.' exception on this line https://github.com/lkosson/reportviewercore/blob/9f0a88b2064c5789f1d52665fa768294c717dc83/Microsoft.ReportViewer.WinForms/Microsoft.Reporting.WinForms/RSParams.cs#L201C10-L201C10 on runtime
EDIT 3
After further debugging it was only needed to add following line to project file:
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
And then it worked - the runtime allows access to BinaryFormatter. This seems to only be workarround for .NET 8 and in .NET 9 it will be completely removed...
from reportviewercore.
Related Issues (20)
- Large file rendering issue HOT 1
- Export PDF in linux is error sometimes HOT 1
- .NET 8 version conflicts with Microsoft.CodeAnalysis.VisualBasic nuget package HOT 9
- MVC Web HOT 2
- CanGrow issue. HOT 1
- RDLC with parameter throw exception when project be published with "PublishSingleFile HOT 1
- File not found when connecting to SSRS HOT 5
- Server report HOT 5
- HTML layout functionality ( pages ) HOT 1
- Exception when using report viewer when publishing application into a single file. HOT 1
- Barcodes support HOT 2
- Automatic loading of RDLC code modules referenced assemblies HOT 1
- Target .net standard 2.0? HOT 8
- replace GetExecutingAssembly with more proper assembly HOT 2
- Invalid report spec HOT 2
- Strong naming? HOT 5
- 窗体设计器无法工作 HOT 1
- WinForms control designer,How to ues it normally with not programmatically? HOT 1
- Exception when rendering RDLC with an expression in Tablix/Visibility/Hidden tag HOT 6
- Date formatting problems HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reportviewercore.