hi,
When trying to print a report in a .net 4.0 WPF application with the latest weekly build (5.7.2012) an exception is raised:
Fehler beim Versuch der SecurityTransparent-Methode "Stimulsoft.Report.Print.StiWpfPrintProvider.Print(System.Object, Boolean, Int32, Int32, Int32, System.String)", auf den sicherheitskritischen Typ "System.Printing.PrintTicket" zuzugreifen.
Die Assembly "Stimulsoft.Report.Wpf, Version=2012.2.1313.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a" ist mit "AllowPartiallyTrustedCallersAttribute" markiert und verwendet das Sicherheitstransparenzmodell der Stufe 2. Bei Festlegung der Transparenz auf Stufe 2 werden alle Methoden in AllowPartiallyTrustedCallers-Assemblys standardmäßig sicherheitstransparent, was die Ursache der Ausnahme sein kann.
bei Stimulsoft.Report.Print.StiWpfPrintProvider.Print(Object printTicketObject, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int32 copies, String printerName)
bei Stimulsoft.Report.StiReport.PrintWithWpfInternal(Object printTicket, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int32 copies, String printerName)
bei Stimulsoft.Report.StiReport.PrintWithWpf(Object printTicket, Boolean showPrintDialog, Int32 fromPage, Int32 toPage, Int32 copies, String printerName)
bei Stimulsoft.Report.StiReport.PrintWithWpf(Object printTicket, Boolean showPrintDialog)
bei Stimulsoft.Report.StiReport.PrintWithWpf(Boolean showPrintDialog)
bei Stimulsoft.Report.StiReport.PrintWithWpf()
bei WpfApplication2.MainWindow.Button_Click_1(Object sender, RoutedEventArgs e) in C:\Users\veiro.ASUT\Documents\Visual Studio 11\Projects\WpfApplication2\WpfApplication2\MainWindow.xaml.cs:Zeile 37.
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
bei System.Windows.Controls.Primitives.ButtonBase.OnClick()
bei System.Windows.Controls.Button.OnClick()
bei System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
bei System.Windows.Input.InputManager.ProcessStagingArea()
bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
bei System.Windows.Threading.Dispatcher.Run()
bei System.Windows.Application.RunDispatcher(Object ignore)
bei System.Windows.Application.RunInternal(Window window)
bei System.Windows.Application.Run(Window window)
bei System.Windows.Application.Run()
bei WpfApplication2.App.Main() in C:\Users\veiro.ASUT\Documents\Visual Studio 11\Projects\WpfApplication2\WpfApplication2\obj\Debug\App.g.cs:Zeile 0.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
This error does not occur if i use the latest stable build 2012.1 (thats my workaround at the moment)
See the attached sample project (be sure to use the latest weekly build assemblies)
Regards eiro
.net 4.0 printing problem
.net 4.0 printing problem
- Attachments
-
- PrintException.zip
- (22.23 KiB) Downloaded 227 times
Re: .net 4.0 printing problem
Hello.
Sorry, we need a little more time to prepare an answer for you.
Thank you.
Sorry, we need a little more time to prepare an answer for you.
Thank you.
Re: .net 4.0 printing problem
.... if you want to have this exception in czech language I can send it
(I don't like localized framework
)
.... no
... but we have the same problem so last prerelease build is not usable for printing.


.... no

Maybe System PrintTicket object has [SecurityCritical] atribute, but your PrintWithWpf method hasn't the same trusted level....Attempt by security transparent method 'Stimulsoft.Report.Print.StiWpfPrintProvider.Print(System.Object, Boolean, Int32, Int32, Int32, System.String)' to access security critical type 'System.Printing.PrintTicket' failed.
Assembly 'Stimulsoft.Report.Wpf, Version=2012.2.1314.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
Re: .net 4.0 printing problem
Hello.
Thank you for information about this issue.
The bug is fixed. The patch will be available in our next prerelease build this week.
Thank you.
Thank you for information about this issue.
The bug is fixed. The patch will be available in our next prerelease build this week.
Thank you.