PDA

View Full Version : .NET question


tbcc
3rd January 2009, 08:14 PM
Hi all!

Probably this is going to be a stupid question, because I just started coding in C# half a year ago, thinking that C# was just like JAVA, you can use it in every platform.

Today I managed to write my first "Hello World" application to Windows Mobile.

First I coded the application and compiled it to x86 (normally with Visual Studio) and tried to run it on WM. It didn't run.

Why? Isn't it the concept of .NET that it can run on every architecture?

After that I managed to figure it out that it has to be a smart device project...

Can someone give me a heads up (or a detailed link where I can RTFM? :)

Thx! :)

Rudegar
3rd January 2009, 08:40 PM
pda's use .net compactframework which is a subset of normal .net
read more here
http://www.google.dk/search?hl=da&q=net+compact+framework+vs.+net&btnG=S%C3%B8g&meta=lr%3Dlang_da%7Clang_en

stephj
7th January 2009, 04:47 PM
From Visual Studio 2005 onwards the IDE embeds a manifest in either the .EXE itself or as a separate file. This contains a list of exactly what the app needs to be present in order to run. The loader on the target machine reads it and makes sure that all this stuff exists on the target, before it will allow it to run. VS2003 was not quite so smart, there is no manifest. If the .NET objects used were present in both .NET 1.0/1.1 and the compact framework .NET 1.1 (i.e CF was the lowest common denominator) then the loader would load it and try and run it. Subject to there being no errors in the just-in-time compile of the .NET CLR and no run time errors of the code, it will work. It is possible to run the same .EXE on a PC and pocket PC, but there are a lot of ifs and buts.

Sometimes less is more......