locked
Full framework binaries on compact framework RRS feed

  • Question

  •  

    Hi All,

    I developed a dynamic linking library (dll) on .NET full framework.  This dll does not includes any platform invoke calls. And all the functions used by this dll supports .NET compact framework as well. My main concern is to use this same dll in .NET compact framework.

    So I am thinking of just using the same dll without recompiling on .NET compact framework.  So what are the recommendations about this approach? Please let me know the difficulties and complexities that could occur in this mechanism.

    Also I've posted same to the following forum as well.

    http://forums.msdn.microsoft.com/en-US/clr/thread/e3f0a625-f3f1-4cad-85ca-563de034b116

    Thank you,

    Sira Buwa.

    Wednesday, June 4, 2008 6:33 AM

Answers

  • That is not going to work but if you compile assemblies for NETCF they might work on the desktop as is provided no device specific functionality is used.

    Wednesday, June 4, 2008 6:58 AM
  • (As I mentioned on your thread in the CLR forum)

     

    The .NET Framework has a concept called retargeting - basically what this means is that, any assembly compiled against the .NET Compact Framework, will automatically work if run on the .NET Framework. However, the reverse is not true.

    For this to work, however, you need to make sure that you only take dependancies on assemblies that either ship in the Compact Framework, or are compiled against the Compact Framework.

     

    Saturday, June 7, 2008 3:20 PM

All replies

  • That is not going to work but if you compile assemblies for NETCF they might work on the desktop as is provided no device specific functionality is used.

    Wednesday, June 4, 2008 6:58 AM
  •  

    As Ilya said, it wont work.
    Wednesday, June 4, 2008 9:58 AM
  • HI All,

    Thank you ceru much for yor comments.

    But I beleve this works fine. But I am not sure (Need to do a example app ahc check).If you check following lincks you can get some idea.

    http://forums.msdn.microsoft.com/en-US/clr/thread/e3f0a625-f3f1-4cad-85ca-563de034b116
    http://msdn.microsoft.com/en-us/library/4swehb60(VS.80).aspx

    But I need to get some theoritical explanation about this. Further I need to know that what are the advers effort that could occur in doing this.. May be the binaries are not optimise to target platform(This is not sure.)

    Thank you,
    Sira Buwa.
    Wednesday, June 4, 2008 12:34 PM
  • You believe incorrect.  It simply cannot work.  Full framework assemblies may use IL opcodes that do not exist in the CF, thy may call classes and methods that don't exists and they may P/Invoke to libraries that don't exist.  For this reason the CF runtime will not even attempt to load a full-framework assembly.

    "So why not just move the full framework to the device?" you may ask.  Well, besides being larger than most devices have space, the framework's native pieces are built for x86 processors (which handhelds are not) and it's compiled to run against Windows XP, not Windows CE, so the OS wouldn't be able to load them.
    Wednesday, June 4, 2008 2:56 PM
  • If you want to only compile for one framework, then compile it for the Compact Framework and, as others have pointed out, it will run correctly on the full framework as long as you did not use anything that is device specific, or CF specific.

     

    Thursday, June 5, 2008 12:56 AM
  • (As I mentioned on your thread in the CLR forum)

     

    The .NET Framework has a concept called retargeting - basically what this means is that, any assembly compiled against the .NET Compact Framework, will automatically work if run on the .NET Framework. However, the reverse is not true.

    For this to work, however, you need to make sure that you only take dependancies on assemblies that either ship in the Compact Framework, or are compiled against the Compact Framework.

     

    Saturday, June 7, 2008 3:20 PM