[Mono-list] Help for porting: VC# 2008express binaries crashing when run by mono

Andy Hume andyhume32 at yahoo.co.uk
Mon Jun 9 05:37:47 EDT 2008


Its (relatively) easily to debug into Mono SWF code, its described at
http://www.mono-project.com/Guide:_Debugging_With_MWF.  In short when
compiling the app, replace the SWF reference to the MWF assembly -- which
needs to be *non*-StrongNamed or the real SWF assembly will be loaded at
runtime.


Its a bit of a shame that the original app needs to be recompiled for this
to work.  It'd be great if Cecil could be used to remap the SWF reference at
runtime, in a wee app like:

   [STAThread]
   static void Main()
   {
      // Choose the target WinForms app
      OpenFileDialog dlg = new OpenFileDialog();
      DialogResult rslt = dlg.ShowDialog();
      if (rslt != DialogResult.OK)
         return;
      String path = dlg.FileName;
      Assembly appOrig = Assembly.LoadFile(path);
      // Cecil magic!
      Assembly app = RemapSwfToMwf(appOrig);
      //
      MethodInfo mi = app.EntryPoint;
      Object[] appArguments = CreateCommandLineArgs(mi);
      // Run!
      mi.Invoke(null, appArguments);
   }

It would be great if someone would like to look at this. :-)


Also, any mention in Mono lists of MSFT code access should probably have a
wee note saying: don't use it if you might every want to contribute to Mono.

Andy



Andrus Moor-2 wrote:
> 
>> the Visual Studio's debugger obviously won't
>> allow me to step into the .NET's own code;
> 
> Even free C# Express 2008 allows to step into MS System.Windows.Forms.dll 
> source code.
> Maybe we can use instructions from
> 
> http://www.codeproject.com/KB/dotnet/netmassdownloader.aspx
> 
> to debug MONO SWF source also.
> 
> Andrus. 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-for-porting%3A-VC--2008-express-binaries-crashing-when-run-by-mono-tp17607386p17729387.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list