473,386 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Share classes / projects between frameworks

Is there a way to easily Share classes / projects between frameworks? say
reg windows and win ce/pocket pc?

Thanks,

Schneider
Jun 27 '08 #1
2 1144
Hi Schneider,

A desktop assembly cannot execute on the device, but the reverse is
possible. If you create a smart device project and build it, the output
(the EXE or DLL) can be executed on the desktop and can be referenced by
desktop projects.

This works because the .NET Compact Framework assemblies are retargetable.
If you open one of them with ILDASM, you can observe that they have the
System.Reflection.AssemblyNameFlags.Retargetable attribute. This means that
at run time all references to the .NET Compact Framework assemblies are
retargeted to the desktop equivalents. So, to be clear, your assembly uses
the desktop implementation, not the device implementation of the .NET
Framework.

Note that the .NET Compact Framework is not a strict subset of the .NET
Framework; it actually adds some members of its own. There are four
device-specific assemblies: System.Data.SqlServerCe, System.Net.IrDA,
Microsoft.WindowsMobile.DirectX and Microsoft.WindowsCE.Forms.

If an assembly built with the .NET Compact Framework uses a device-specific
type, when it is executed on desktop, an exception will be thrown.

For more information about sharing code between full .NET Framework and
Compact Framework, please refer to the following article:

"Write Code Once For Both Mobile And Desktop Apps"
http://msdn.microsoft.com/en-us/magazine/cc163387.aspx

Hope this helps.
If you have any other question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 27 '08 #2
Yes, I have ran PPC apps on the desktops before, thought it's not as nice as
a full Windows app.

In my case it's a set of custom windows controls, which in theory should
work on CE, PPC, ...
I do have the controls logically separated also, Abstract Interfaces,
Business logic, Rendering logic, and testing application, so I would think
it should be easier to convert.

Schneider

"Linda Liu[MSFT]" <v-****@online.microsoft.comwrote in message
news:nK**************@TK2MSFTNGHUB02.phx.gbl...
Hi Schneider,

A desktop assembly cannot execute on the device, but the reverse is
possible. If you create a smart device project and build it, the output
(the EXE or DLL) can be executed on the desktop and can be referenced by
desktop projects.

This works because the .NET Compact Framework assemblies are retargetable.
If you open one of them with ILDASM, you can observe that they have the
System.Reflection.AssemblyNameFlags.Retargetable attribute. This means
that
at run time all references to the .NET Compact Framework assemblies are
retargeted to the desktop equivalents. So, to be clear, your assembly uses
the desktop implementation, not the device implementation of the .NET
Framework.

Note that the .NET Compact Framework is not a strict subset of the .NET
Framework; it actually adds some members of its own. There are four
device-specific assemblies: System.Data.SqlServerCe, System.Net.IrDA,
Microsoft.WindowsMobile.DirectX and Microsoft.WindowsCE.Forms.

If an assembly built with the .NET Compact Framework uses a
device-specific
type, when it is executed on desktop, an exception will be thrown.

For more information about sharing code between full .NET Framework and
Compact Framework, please refer to the following article:

"Write Code Once For Both Mobile And Desktop Apps"
http://msdn.microsoft.com/en-us/magazine/cc163387.aspx

Hope this helps.
If you have any other question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.


Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: AARON PECORARO | last post by:
I need to split apart my web application into multiple projects to allow it to be distributed in parts, but all of the projects need to work together (ie. they need to share session information)....
2
by: Brad Wood | last post by:
Using VS2003, I can't add an existing class to a project w/o the IDE creating a copy of it. I want multiple projects to be able to share a central copy of a class. I can't compile the shared...
3
by: Newbee Adam | last post by:
anyone have any secrets or pearls about vb.net you want to share I was asked by my company to begin teach an introductory VB.Net course 2 day seminar. I had been teaching an sql server 2000...
1
by: Macca | last post by:
Hi, I have a C# Solution/Application that contain 4 projects. Each of these projects needs at some time to access the same database. I would like to know how to share a single connection...
1
by: Raed Sawalha | last post by:
I have a web application with 100 pages and 30 user controls so we decided to separate some pages and controls into sub projects ( the generated subprojects was 2) the problem we have that now the...
8
by: William Meitzen | last post by:
Does someone know how I can get two projects to share a common class? Something like this: solution WholeShmeer project1 code1 CommonClass project2 code2 CommonClass
3
by: musosdev | last post by:
Hi guys Okay, I've setup my projects to open and compile fine in VS2005 using FPSE and remote web, but it's *really* slow. So I thought I'd have a go at doing it the normal way, by loading from...
11
by: Sean Campbell | last post by:
Hello everyone! I just finished writing a small app in VB 2005. I paid very close attention to using only Framework 1.1 commands since my client has not yet installed the Framework 2.0 across...
2
by: Paul | last post by:
I have a class that references/consumes a webservice, and I would like to split that class into a base class to be used as a based for classes in each of two class libraries/DLLs. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.