PC Review


Reply
Thread Tools Rate Thread

C# 2.0 vs. .NET Compact Framework 2.0

 
 
=?Utf-8?B?SXZhbg==?=
Guest
Posts: n/a
 
      25th Jun 2006
C# 2.0 is obviously a programning language, and the .NET Compact Framework
2.0 (CF 2.0) only defines high level classes/data
types/components/controls/etc to be used with that programming language,
correct?

If so, are there only certain versions of C# that can be uses with CF 2.0 ,
or can all versions of C# be used to access CF 2.0?

Furthermore, are there OS version restrictions when work with new versions
of C#? For example... Can one compile and run C# 2.0 code on older OS
versions such as Pocket PC 2002, as long as they don't use an unsupported CF
version (i.e. CF 2.0)?

thanks
 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      26th Jun 2006
I don't know what a C# 2.0 is, but I think that you're confusing two
concepts. The tools themselves can generate code in certain patterns, some
of which might be supported by a given version of the run-time framework and
some which might not.

However, if you're talking about C# as provided in Visual Studio 2005, it
can generate suitable code for either .NET Compact Framework 1.0 or 2.0 and,
in fact, the project templates that you get for Smart Device applications in
VS2005 allow you to choose which target will be used. If your project
targets .NET CF 1.0, then it should run on devices that have either .NET CF
1.0 or 2.0 on them. If you target .NET CF 2.0, no, that code won't run on a
device without .NET CF 2.0.

Paul T.

"Ivan" <(E-Mail Removed)> wrote in message
news:64CE0F2D-DE47-4F4A-9DF9-(E-Mail Removed)...
> C# 2.0 is obviously a programning language, and the .NET Compact Framework
> 2.0 (CF 2.0) only defines high level classes/data
> types/components/controls/etc to be used with that programming language,
> correct?
>
> If so, are there only certain versions of C# that can be uses with CF 2.0
> ,
> or can all versions of C# be used to access CF 2.0?
>
> Furthermore, are there OS version restrictions when work with new versions
> of C#? For example... Can one compile and run C# 2.0 code on older OS
> versions such as Pocket PC 2002, as long as they don't use an unsupported
> CF
> version (i.e. CF 2.0)?
>
> thanks



 
Reply With Quote
 
Guest
Posts: n/a
 
      26th Jun 2006
I *think* he's trying to ask if he can use the new language features of C#
(generics and the like) in a CF 1.0 project. I would suspect that if you
build with Studio 05 that you can, but I've not tested that. Of course
testing it would be really simple, so I'll leave it to the OP.

-Chris




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%(E-Mail Removed)...
>I don't know what a C# 2.0 is, but I think that you're confusing two
>concepts. The tools themselves can generate code in certain patterns, some
>of which might be supported by a given version of the run-time framework
>and some which might not.
>
> However, if you're talking about C# as provided in Visual Studio 2005, it
> can generate suitable code for either .NET Compact Framework 1.0 or 2.0
> and, in fact, the project templates that you get for Smart Device
> applications in VS2005 allow you to choose which target will be used. If
> your project targets .NET CF 1.0, then it should run on devices that have
> either .NET CF 1.0 or 2.0 on them. If you target .NET CF 2.0, no, that
> code won't run on a device without .NET CF 2.0.
>
> Paul T.
>
> "Ivan" <(E-Mail Removed)> wrote in message
> news:64CE0F2D-DE47-4F4A-9DF9-(E-Mail Removed)...
>> C# 2.0 is obviously a programning language, and the .NET Compact
>> Framework
>> 2.0 (CF 2.0) only defines high level classes/data
>> types/components/controls/etc to be used with that programming language,
>> correct?
>>
>> If so, are there only certain versions of C# that can be uses with CF 2.0
>> ,
>> or can all versions of C# be used to access CF 2.0?
>>
>> Furthermore, are there OS version restrictions when work with new
>> versions
>> of C#? For example... Can one compile and run C# 2.0 code on older OS
>> versions such as Pocket PC 2002, as long as they don't use an unsupported
>> CF
>> version (i.e. CF 2.0)?
>>
>> thanks

>
>



 
Reply With Quote
 
Ilya Tumanov [MS]
Guest
Posts: n/a
 
      26th Jun 2006
NETCF V2 is not just a set of "high level classes/data
types/components/controls/etc", it's also a runtime which compiles IL into
native code and executes it.

It has to know how to handle IL produced by C# 2.0 features or it won't
work.



So the answer is no: you can not run C# 2.0 code without NETCF V2.


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/...ramework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Ivan" <(E-Mail Removed)> wrote in message
news:64CE0F2D-DE47-4F4A-9DF9-(E-Mail Removed)...
> C# 2.0 is obviously a programning language, and the .NET Compact Framework
> 2.0 (CF 2.0) only defines high level classes/data
> types/components/controls/etc to be used with that programming language,
> correct?
>
> If so, are there only certain versions of C# that can be uses with CF 2.0
> ,
> or can all versions of C# be used to access CF 2.0?
>
> Furthermore, are there OS version restrictions when work with new versions
> of C#? For example... Can one compile and run C# 2.0 code on older OS
> versions such as Pocket PC 2002, as long as they don't use an unsupported
> CF
> version (i.e. CF 2.0)?
>
> thanks



 
Reply With Quote
 
=?Utf-8?B?SXZhbg==?=
Guest
Posts: n/a
 
      28th Jun 2006
I was actually trying to create a singleton through a static class. From
what I have read it appears that this is only possible via C# 2.0, which I
assume ships with VS2005 and must be run in conjunction with CF 2.0,
according to Ilya.

I was trying to write something like this:

public static class Foo
{
public static void method_one()
{
}
}

Since I’m trying to write code that works on CF 1.0 & greater, I guess I
will have to settle for something like:

public class Foo
{
private foo()
{
}

public static void method_one()
{
}
}

Ivan


"Ilya Tumanov [MS]" wrote:

> NETCF V2 is not just a set of "high level classes/data
> types/components/controls/etc", it's also a runtime which compiles IL into
> native code and executes it.
>
> It has to know how to handle IL produced by C# 2.0 features or it won't
> work.
>
>
>
> So the answer is no: you can not run C# 2.0 code without NETCF V2.
>
>
> --
> Best regards,
>
> Ilya
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> *** Want to find answers instantly? Here's how... ***
>
> 1. Go to
> http://groups-beta.google.com/group/...ramework?hl=en
> 2. Type your question in the text box near "Search this group" button.
> 3. Hit "Search this group" button.
> 4. Read answer(s).
>
> "Ivan" <(E-Mail Removed)> wrote in message
> news:64CE0F2D-DE47-4F4A-9DF9-(E-Mail Removed)...
> > C# 2.0 is obviously a programning language, and the .NET Compact Framework
> > 2.0 (CF 2.0) only defines high level classes/data
> > types/components/controls/etc to be used with that programming language,
> > correct?
> >
> > If so, are there only certain versions of C# that can be uses with CF 2.0
> > ,
> > or can all versions of C# be used to access CF 2.0?
> >
> > Furthermore, are there OS version restrictions when work with new versions
> > of C#? For example... Can one compile and run C# 2.0 code on older OS
> > versions such as Pocket PC 2002, as long as they don't use an unsupported
> > CF
> > version (i.e. CF 2.0)?
> >
> > thanks

>
>
>

 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      30th Jun 2006
Yes, you can do static classes in v1.0 by making the ctor private like you
have done but also remember to make the class sealed.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

"Ivan" <(E-Mail Removed)> wrote in message
news:005818FD-757B-4E97-8101-(E-Mail Removed)...
>I was actually trying to create a singleton through a static class. From
> what I have read it appears that this is only possible via C# 2.0, which I
> assume ships with VS2005 and must be run in conjunction with CF 2.0,
> according to Ilya.
>
> I was trying to write something like this:
>
> public static class Foo
> {
> public static void method_one()
> {
> }
> }
>
> Since I'm trying to write code that works on CF 1.0 & greater, I guess I
> will have to settle for something like:
>
> public class Foo
> {
> private foo()
> {
> }
>
> public static void method_one()
> {
> }
> }
>
> Ivan
>
>
> "Ilya Tumanov [MS]" wrote:
>
>> NETCF V2 is not just a set of "high level classes/data
>> types/components/controls/etc", it's also a runtime which compiles IL
>> into
>> native code and executes it.
>>
>> It has to know how to handle IL produced by C# 2.0 features or it won't
>> work.
>>
>>
>>
>> So the answer is no: you can not run C# 2.0 code without NETCF V2.
>>
>>
>> --
>> Best regards,
>>
>> Ilya
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> *** Want to find answers instantly? Here's how... ***
>>
>> 1. Go to
>> http://groups-beta.google.com/group/...ramework?hl=en
>> 2. Type your question in the text box near "Search this group" button.
>> 3. Hit "Search this group" button.
>> 4. Read answer(s).
>>
>> "Ivan" <(E-Mail Removed)> wrote in message
>> news:64CE0F2D-DE47-4F4A-9DF9-(E-Mail Removed)...
>> > C# 2.0 is obviously a programning language, and the .NET Compact
>> > Framework
>> > 2.0 (CF 2.0) only defines high level classes/data
>> > types/components/controls/etc to be used with that programming
>> > language,
>> > correct?
>> >
>> > If so, are there only certain versions of C# that can be uses with CF
>> > 2.0
>> > ,
>> > or can all versions of C# be used to access CF 2.0?
>> >
>> > Furthermore, are there OS version restrictions when work with new
>> > versions
>> > of C#? For example... Can one compile and run C# 2.0 code on older OS
>> > versions such as Pocket PC 2002, as long as they don't use an
>> > unsupported
>> > CF
>> > version (i.e. CF 2.0)?
>> >
>> > thanks

>>
>>
>>



 
Reply With Quote
 
Mullet
Guest
Posts: n/a
 
      30th Jun 2006
My understanding is that generics is built into the framework, so you
wouldn't be able to get the new features on CF 1.0. I could be wrong though.

"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
news:(E-Mail Removed)...
>I *think* he's trying to ask if he can use the new language features of C#
>(generics and the like) in a CF 1.0 project. I would suspect that if you
>build with Studio 05 that you can, but I've not tested that. Of course
>testing it would be really simple, so I'll leave it to the OP.
>
> -Chris
>
>
>
>
> "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> com> wrote in message news:%(E-Mail Removed)...
>>I don't know what a C# 2.0 is, but I think that you're confusing two
>>concepts. The tools themselves can generate code in certain patterns,
>>some of which might be supported by a given version of the run-time
>>framework and some which might not.
>>
>> However, if you're talking about C# as provided in Visual Studio 2005, it
>> can generate suitable code for either .NET Compact Framework 1.0 or 2.0
>> and, in fact, the project templates that you get for Smart Device
>> applications in VS2005 allow you to choose which target will be used. If
>> your project targets .NET CF 1.0, then it should run on devices that have
>> either .NET CF 1.0 or 2.0 on them. If you target .NET CF 2.0, no, that
>> code won't run on a device without .NET CF 2.0.
>>
>> Paul T.
>>
>> "Ivan" <(E-Mail Removed)> wrote in message
>> news:64CE0F2D-DE47-4F4A-9DF9-(E-Mail Removed)...
>>> C# 2.0 is obviously a programning language, and the .NET Compact
>>> Framework
>>> 2.0 (CF 2.0) only defines high level classes/data
>>> types/components/controls/etc to be used with that programming language,
>>> correct?
>>>
>>> If so, are there only certain versions of C# that can be uses with CF
>>> 2.0 ,
>>> or can all versions of C# be used to access CF 2.0?
>>>
>>> Furthermore, are there OS version restrictions when work with new
>>> versions
>>> of C#? For example... Can one compile and run C# 2.0 code on older OS
>>> versions such as Pocket PC 2002, as long as they don't use an
>>> unsupported CF
>>> version (i.e. CF 2.0)?
>>>
>>> thanks

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any suggestion for directory layout of project support both Full.NET Framework and Compact Framework? ping235 Microsoft C# .NET 0 24th May 2007 03:22 AM
Any suggestion for directory layout of project support both Full.NET Framework and Compact Framework? ping235 Microsoft Dot NET Framework 2 22nd May 2007 02:35 AM
.Net compact Framework throwing formatException which 'normal' framework doesn't John Haxton Microsoft Dot NET Framework 0 20th Apr 2004 02:47 PM
Building a SOAP Message (in Compact Framework) [REPLYING FROM microsoft.public.dotnet.framework] news.microsoft.com Microsoft Dot NET Compact Framework 1 2nd Apr 2004 10:14 PM
Building a SOAP Message (in Compact Framework) [REPLYING FROM microsoft.public.dotnet.framework] news.microsoft.com Microsoft Dot NET Framework 0 16th Mar 2004 04:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:47 PM.