Cannot run .NET CF applications

G

Guest

Hi
i'm trying to see how .NET CF applications looks like on my PocketPC 2002. So, i wrote a very simple dummy windows form in C#

using System.Windows.Forms

public class DummyFor

public static void Main(

Application.Run(new Form())



I compiled that with csc command line tool distributed with .NET framework 1.1

csc /t:winexe /r:System.dll /r:System.Windows.Forms.dll DummyForm.c

Compilation ends without errors and produces my DummyForm.exe executable that works fine on the desktop PCs i tried it on

Then, i use ActiveSync 3.7 to copy this executable on my iPaq h5450, where i previously installed .NET Compact Framework SP2 (looking at Microsoft's download pages it seem's that nothing else is required to run .NET applications on PPC)

When i launch it on the iPaq, i get a TypeLoadException on System.Windows.Forms.Form type

Please help me understand what is wrong with this: i've controlled iPaq's Windows directory and seen that there is a file named 'GAC_System.Windows.Forms_v1_0_5000_0_cneutral_1' (that is the same version of this assembly included into .NET Framework 1.1), so i suppose that the classes within the namespace System.Windows.Forms are registered

Note that i can't use Visual Studio .NET 2003 because i haven't got it (and -given also the price-, before purchasing it, i'd like to do some tries with hand-written and comman-line compiled applications on my iPaq)

Thank
Fabio
 
J

James McCutcheon

I believe you have compiled it with the wrong framework ie the full (1.1)
not the compact framework (1.0 sp1)

See this article ...
http://dotnetdn.com/without-visual-studio/

James McCutcheon

Fabio said:
Hi,
i'm trying to see how .NET CF applications looks like on my PocketPC 2002.
So, i wrote a very simple dummy windows form in C#:
using System.Windows.Forms;

public class DummyForm
{
public static void Main()
{
Application.Run(new Form());
}
}

I compiled that with csc command line tool distributed with .NET framework 1.1:

csc /t:winexe /r:System.dll /r:System.Windows.Forms.dll DummyForm.cs

Compilation ends without errors and produces my DummyForm.exe executable
that works fine on the desktop PCs i tried it on.
Then, i use ActiveSync 3.7 to copy this executable on my iPaq h5450, where
i previously installed .NET Compact Framework SP2 (looking at Microsoft's
download pages it seem's that nothing else is required to run .NET
applications on PPC).
When i launch it on the iPaq, i get a TypeLoadException on
System.Windows.Forms.Form type.
Please help me understand what is wrong with this: i've controlled iPaq's
Windows directory and seen that there is a file named
'GAC_System.Windows.Forms_v1_0_5000_0_cneutral_1' (that is the same version
of this assembly included into .NET Framework 1.1), so i suppose that the
classes within the namespace System.Windows.Forms are registered.
Note that i can't use Visual Studio .NET 2003 because i haven't got it
(and -given also the price-, before purchasing it, i'd like to do some tries
with hand-written and comman-line compiled applications on my iPaq).
 
M

Maarten Struys, eMVP

You compiled against the full .NET Framework and what you need is the .NET
CF? When you have Visual Studio.NET 2003 you can create smart device
applications from the IDE. You can also take a look here to create apps
without VS.NET 2003: http://www.opennetcf.org/Forums/topic.asp?TOPIC_ID=341.


--
Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com

Fabio said:
Hi,
i'm trying to see how .NET CF applications looks like on my PocketPC 2002.
So, i wrote a very simple dummy windows form in C#:
using System.Windows.Forms;

public class DummyForm
{
public static void Main()
{
Application.Run(new Form());
}
}

I compiled that with csc command line tool distributed with .NET framework 1.1:

csc /t:winexe /r:System.dll /r:System.Windows.Forms.dll DummyForm.cs

Compilation ends without errors and produces my DummyForm.exe executable
that works fine on the desktop PCs i tried it on.
Then, i use ActiveSync 3.7 to copy this executable on my iPaq h5450, where
i previously installed .NET Compact Framework SP2 (looking at Microsoft's
download pages it seem's that nothing else is required to run .NET
applications on PPC).
When i launch it on the iPaq, i get a TypeLoadException on
System.Windows.Forms.Form type.
Please help me understand what is wrong with this: i've controlled iPaq's
Windows directory and seen that there is a file named
'GAC_System.Windows.Forms_v1_0_5000_0_cneutral_1' (that is the same version
of this assembly included into .NET Framework 1.1), so i suppose that the
classes within the namespace System.Windows.Forms are registered.
Note that i can't use Visual Studio .NET 2003 because i haven't got it
(and -given also the price-, before purchasing it, i'd like to do some tries
with hand-written and comman-line compiled applications on my iPaq).
 
M

Mike

The problem is probably that you compiled with a .NET framework compiler.
You probably have to do something different to tell it to use the Compact
Framework instead of the full Framework.

Fabio said:
Hi,
i'm trying to see how .NET CF applications looks like on my PocketPC 2002.
So, i wrote a very simple dummy windows form in C#:
using System.Windows.Forms;

public class DummyForm
{
public static void Main()
{
Application.Run(new Form());
}
}

I compiled that with csc command line tool distributed with .NET framework 1.1:

csc /t:winexe /r:System.dll /r:System.Windows.Forms.dll DummyForm.cs

Compilation ends without errors and produces my DummyForm.exe executable
that works fine on the desktop PCs i tried it on.
Then, i use ActiveSync 3.7 to copy this executable on my iPaq h5450, where
i previously installed .NET Compact Framework SP2 (looking at Microsoft's
download pages it seem's that nothing else is required to run .NET
applications on PPC).
When i launch it on the iPaq, i get a TypeLoadException on
System.Windows.Forms.Form type.
Please help me understand what is wrong with this: i've controlled iPaq's
Windows directory and seen that there is a file named
'GAC_System.Windows.Forms_v1_0_5000_0_cneutral_1' (that is the same version
of this assembly included into .NET Framework 1.1), so i suppose that the
classes within the namespace System.Windows.Forms are registered.
Note that i can't use Visual Studio .NET 2003 because i haven't got it
(and -given also the price-, before purchasing it, i'd like to do some tries
with hand-written and comman-line compiled applications on my iPaq).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top