Problems with using ScintillaNet

Topics: Developer Forum, Project Management Forum, User Forum
Sep 2, 2010 at 11:29 AM
Edited Sep 2, 2010 at 12:16 PM

Hi folks,

I created a new WPF project with VS2008 and added the Reference of Scintilla and WindowsFormsIntegration. So far so good.
Now i added the WindowsFormsHost as a child of a Grid and the ScintillaNet as a child of the WindowsFormsHost.

This looks like:

<Window x:Class="ScintillaTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:scintilla="clr-namespace:ScintillaNet;assembly=ScintillaNet"
Title="Window1" Height="300" Width="300">
<Grid>
<WindowsFormsHost>
<scintilla:Scintilla/>
</WindowsFormsHost>
</Grid>
</Window>

No Code behind or other stuff only the 4 lines...but when i try to start/build that little Program i get a a Error "Could not create an instance of type 'Scintilla'." or "Cannot create instance of 'Scintilla' defined in assembly 'ScintillaNet, Version=2.2.3581.19319, Culture=neutral, PublicKeyToken=948d6c9751444115'. Exception has been thrown by the target of an invocation. Error at object 'System.Windows.Forms.Integration.WindowsFormsHost' in markup file 'WpfApplication1;component/window1.xaml' Line 8 Position 14." I should say that i run this code followed system: Win7 Home Premium x64.

I tried on an other machines too: Win7 Ultimate Version x86/x64 but i get no error!!!! WTF?

Can anyone confirm that too?
Have anyone any suggestions for my problem? Maybe its not compatible with Home Versions but i don't think so.

Thx

Feb 1, 2011 at 9:38 PM

Hi there !

I have exactly the same problem. It works perfectly on my machine, Windows 7, yet it fails to initialize on another machine.

Any idea ?

Frank

 

Oct 3, 2012 at 10:16 AM

Make sure the target framework of your project is not "Client Profile".

1. Right click the project -> Properties.
2. In the "Target framework" combo box choose  ".NET Framework 4" (instead of ".NET Framework 4 Client Profile").

Goodluck.

Oct 4, 2012 at 7:23 PM

I'm not wrong, this bug can be fixed by just adding a reference to "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\System.Design.dll".