Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IsRichTextFormat Throws FileLoadException

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
morgenweck



Joined: 09 Jun 2010
Posts: 21

PostPosted: Tue Jan 18, 2011 4:52 pm    Post subject: IsRichTextFormat Throws FileLoadException Reply with quote

I'm upgrading from version 3 to version 4 and also changing from Framework 2.0 to 4.0. When I set a cell to IsRichTextFormat = True it throws an error saying:
Mixed mode assembly is built against version v2.0.50727 of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

As soon as I put IsRichTextFormat to false I can load the Object into the tree without any FileLoadExceptions.

I can send screenshot if necessary.

Thanks

Additional information:

System.IO.FileLoadException occurred
Message=Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
Source=Infralution.Controls.VirtualTree
StackTrace:
at Infralution.Controls.VirtualTree.CellWidget.PaintRichText(Graphics graphics, Rectangle bounds)
at Infralution.Controls.VirtualTree.CellWidget.PaintText(Graphics graphics, Rectangle bounds, Style style, String text, Boolean printing)
at Infralution.Controls.VirtualTree.CellWidget.PaintForeground(Graphics graphics, Style style, Boolean printing)
at Infralution.Controls.VirtualTree.CellWidget.OnPaint(Graphics graphics)
at Infralution.Controls.Widget.OnPaint(Graphics graphics)
at Infralution.Controls.VirtualTree.RowWidget.OnPaint(Graphics graphics)
at Infralution.Controls.Widget.OnPaint(Graphics graphics)
at Infralution.Controls.VirtualTree.PanelWidget.OnPaint(Graphics graphics)
at Infralution.Controls.WidgetControl.PaintWidgets(Graphics graphics, Rectangle clipRectangle)
at Infralution.Controls.WidgetControl.OnPaint(PaintEventArgs e)
at Infralution.Controls.VirtualTree.VirtualTree.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at Infralution.Controls.BorderedControl.WndProc(Message& m)
at Infralution.Controls.VirtualTree.VirtualTree.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Program.Main() in C:\Projects\AdminDatabase\DataCenterCore\Program.vb:line 20
InnerException:
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jan 19, 2011 10:33 pm    Post subject: Reply with quote

The problem is that in .NET 4 Microsoft decided not (by default) to keep backward compatibility for loading mixed mode assemblies compiled using C++ against .NET 2. Since the Infralution.RichText assembly is compiled against .NET 2 this issue arises if you use RichText with a .NET 4 application. There are three possible solutions:

1. Add a configuration file for your application with the following Startup attribute:
Code:
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
  </startup>
</configuration>


This enables backward compatible loading of mixed mode assemblies (.NET 4 assemblies will still load OK). It is also possible to configure this programmatically – but I can’t find the reference on how to do this.

2. If you have purchased the source code you could recompile the Infralution.RichText assembly to target .NET 4 Framework. You would also need to recompile the other Virtual Tree assemblies to use it.

3. Don’t use Rich Text.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Dec 29, 2011 4:33 am    Post subject: Reply with quote

Version 4.2.0 of Virtual Tree has been released and eliminates this issue. Rich Text rendering is now implemented in managed code (in Infralution.Controls.RichTextRenderer) eliminating the need for the Infralution.RichText mixed mode assembly.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group