[C#] Problème webbrowser avec SVG
Bonjour à tous,
J'aimerais pouvoir afficher le contenu d'un fichier SVG dans le composant webbrowser (ou un autre).
J'ai crée un projet C# windows form (testé avec framework 2.0, 3.0, et 4.0) et rajouté le contrôle webbrowser.
J'ai rajouté l'URI du fichier à ouvrir comme ceci :
Code:
1 2 3
|
string fichier = Application.StartupPath + "/grapheTemp.svg";
webBrowser1.Navigate(new Uri("file://" + fichier)); |
et quand je lance l'appli j'obtiens une erreur :
Citation:
L'exception System.AccessViolationException n'a pas été gérée
Message=Tentative de lecture ou d'écriture de mémoire protégée. Cela indique souvent qu'une autre mémoire est endommagée.
Source=System.Windows.Forms
StackTrace:
à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.Run(Form mainForm)
à WindowsFormsApplication1.Program.Main() dans C:\Users\ALEX\Documents\Prototype Client Léger\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:ligne 17
à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException:
sur la ligne :
Code:
Application.Run(new Form1());
Voici ce que j'ai essayé sans résultats :
- installer adobe SVG viewer 3.03
- insérer le contrôle SVG Document d'adobe au lieu du webbrowser mais ça me fait planter VS2010
- lancer avec le webbrowser une URI http contenant des images SVG : même erreur
- lancer www.google.fr : pas d'erreur
- Le fichier que je veux ouvrir s'affiche correctement en IE8 et Firefox 6
J'ai le même programme en VB6 et cela marche très bien, si quelqu'un a une idée je vous remercie d'avance