DemoMap.exe crashes (x86 Framework 3.5 - Windows xp)

Dec 2, 2010 at 11:10 PM

Hi,

I've just downloaded DotSpatial x86 framework 3.5 for the very first time. I've tried to run MapDemo but it crashes at the following step:

((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();

inside Demo Projects\TestViewer\TestViewer\MainForm.Designer.cs
The error says (I trnslate from italian) that System.Windows.Forms.SplitContainer cannot be casted to System.ComponentModel.ISupportInitialize

I'm on a Windows XP SP2 machine, with .NET 3.5 SP1

Giovanni

Developer
Dec 2, 2010 at 11:31 PM

This line creeps in from time to time.  It is generated by the auto code.  I was not aware that it had crept in again, and everything compiled fine, so I didn't catch it.  Sorry about that.  If you don't mind working with source code, then you can pull the code from the repository.  By default the code is in 4.0, but theoretically compatible with 3.5 except for where the automatic code generation sometimes causes problems.  One option is to switch all projects to 3.5 before compiling.  To speed this up, you can use a macro available on the web http://cid-93d618d639ec9651.skydrive.live.com/self.aspx/Public/Visual%20Studio%202008%20Macros/ProjectUtilities.vb?wa=wsignin1.0&sa=600116821 which is explained in this article http://www.codeproject.com/Articles/74805/Visual-Studio-2010-and-Target-Framework-Version.aspx to change all the projects to 3.5 (Not client profile).  The other alternative is to use MSBuild inorder with a compiler switch.  You can probably paste the following line into the command prompt in order to get the build you want:

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "C:\dev\DotSpatial\DotSpatial.sln" /t:rebuild /v:quiet /p:TargetFrameworkVersion=v3.5 /p:Configuration=Release /p:Platform=x86

Be sure to use the 4.0 version of MSBuild, and make sure that you swap out the paths to be ones that work on your computer.  So before you rebuild, you just need to delete the line you posted about that says:

((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();

there will be another line with ISupportInitialize that must be removed as well that calls EndInit().  If you are not up to doing a recompile yourself, I will simply post this as a note, and hopefully the release next week will work better for you, if we don't get around to posting an update before then.

Ted

Dec 3, 2010 at 10:11 AM
Thanks Ted,
I won't be able to test your suggestions untile next week, so probably
I will wait for the next release.
Thank you for the very detailed description!

Giovanni