all groups > dotnet compact framework > february 2005 >
You're in the

dotnet compact framework

group:

System.NotSupportedException - on F5 debug but not on CTRL-F5



System.NotSupportedException - on F5 debug but not on CTRL-F5 Carl Perkins
2/16/2005 5:23:01 PM
dotnet compact framework: I built an application that works 100% ok when I run it in debug mode but
with CTRL-F5.
I changed to deploy and get the System.NotSupportedException message.
I ALSO get the error when I run in debug mode with F5 (not CTRL-F5).
Here is a partial piece of code:

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlServerCe;
using System.Text.RegularExpressions;

namespace NJ5J_CarLog_PocketPC
{
public class formCarLog : System.Windows.Forms.Form
{
public string wrkMaximumMileageStart = "9999991.0";
public string wrkMaximumMileageEnd = "9999999.9";
public decimal maximumMileageStart = 0;
public decimal maximumMileageEnd = 0;
public formCarLog()
{
InitializeComponent();
maximumMileageStart =
System.Convert.ToDecimal(wrkMaximumMileageStart.ToString());

The last instruction above is what gives the exception. I found another
solution on this newsgroup and tried Parse() but it also gives the exception.
Is there a namespace I am omitting? The MSDN help shows that this is
supported in the .Net Compact Framework.
Thanks in advance,
Re: System.NotSupportedException - on F5 debug but not on CTRL-F5 Alex Feinman [MVP]
2/16/2005 6:48:50 PM
Try moving the call to Convert.ToDecimal to the Form.Load

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]
Re: System.NotSupportedException - on F5 debug but not on CTRL-F5 Carl Perkins
2/16/2005 7:47:02 PM
I haven't tried that BUT several posts mentioned that InitializeComponent()
must be kept small.
So I went into InitializeComponent() and pulled a LOT of code out and put
into my own method that I execute right after InitializeComponent() and
everything is now working - I did not have to drop any objects!!!
Apparently there is a limit on how many object references can be made in
InitializeComponent().
Thanks,
Carl Perkins

[quoted text, click to view]
AddThis Social Bookmark Button