This project is read-only.

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

Dec 3, 2010 at 12:10 AM


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:


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


Dec 3, 2010 at 12:31 AM

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 which is explained in this article 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:


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.


Dec 3, 2010 at 11: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!