![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Share classes / projects between frameworks 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: msdnmg@xxxxxx. ================================================== 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. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Share classes / projects between frameworks 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-lliu@xxxxxx> wrote in message news:nKL5cjKvIHA.1788@xxxxxx Quote: > 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: > msdnmg@xxxxxx. > > ================================================== > 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. > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Cannot find .NET Frameworks listed in Vista system | .NET General | |||
| Recent projects | .NET General | |||
| What Are the Differences between 3.5 Framework and Earlier Frameworks? | .NET General | |||
| Differences between Framework 3.5 and Earlier Frameworks? | .NET General | |||