none
Building OS in VS2005 and Application in VS2008 RRS feed

  • Question

  • I am using VS 2005 to build my OS (since 2008 does not have Platform builder).

    I am developing the application in VS 2008 to take advantage of the Smart Device Unit testing.

    I am trying to figure out the best way for my final release build of NK.bin which will first build my application, then build the OS (in kiosk mode)  the OS build should include the 2008 application image.

    The complication is that I am using 2 different version of VS.

     

    Thanks,

    Brian

    Friday, November 5, 2010 8:14 AM

All replies

  • Is your application written in managed or unmanaged code ?

    In the first case (managed) you can develop application without problem in VS2008 and then debugging your application on the target via VS2008.

    In the secondo case (unmanaged) i think that the best way is to develop your application as OS solution subproject inside VS2005 for debugging better. It is only my idea.

    Paolo.

    Friday, November 5, 2010 8:23 AM
  • Hi Paolo,

    My 2008 application is managed code. I have no problem debugging this 2008 manages application during development.

    I want to know how I will perform a final release build which will be used for the final image that I will install on the device - the nk.bin image. This image will have to managed 2008 application and the 2005 OS.

    Brian

     

    Friday, November 5, 2010 9:06 AM
  • To include your managed application assemblies (EXE, DLL) into your NK.bin, you have to modify a .bib file. The possible solutions are the following :

    1. platform.bib : it is the worst solution;
    2. project.bib : it's better then the first;
    3. <subproject>.bib : create a subproject inside your OS solution without sorce code but using its bib file to include your managed application;

    Remember to include your application inside FILES section.

    Paolo.

    Friday, November 5, 2010 9:36 AM
  • Brian:

    The answer is that you would build your app first and then build the OS.   But you already knew that, so what are you really asking?


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Friday, November 5, 2010 10:49 AM
    Moderator
  •  

    I would like there to be a dependency from a VS2005 project to a VS2008 project. So that the VS builds all the dependent projects automatically.

    Now there is nothing in VS2005 that would allow it to depend on a VS2008 application. I am wondering if anyone has managed to work this into their build preocess. I assume other people have seen the same relationshipd i.e. VS2005 OS design and VS2008 application.

    My key request is for it to be done as part of the build so that a developmer does  not have to remember to build the VS2008 app first.

    Thanks,

    Brian

    Friday, November 5, 2010 3:10 PM
  • No there isn't any dependency...You have to build VS2008 application first and then include it into OS image (with VS2005) in the way I have told you.

    Paolo.

    Friday, November 5, 2010 7:12 PM
  • Brian:

    Since the projects are using two different tools, there is no built in way to build the VS2008 project from Platform Builder.  But you could create a make file for your VS2008 project and build it from Platform Builder.  I am not suggesting that this is an easy or straight forward solution.  One way would be to use makefile.inc, similar to http://geekswithblogs.net/BruceEitman/archive/2008/05/08/windows-ce-platform-builder--automatically-putting-files-in-the.aspx but instead of copying files build your VS2008 project.

    If it were me, I would probably create a batch file that builds both the VS2008 app and the OS.  This might take some research on your part, but this should get you started:  http://geekswithblogs.net/BruceEitman/archive/2008/05/07/using-a-batch-file-to-automatically-build-a-windows-ce.aspx


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Friday, November 5, 2010 8:48 PM
    Moderator
  • Hi,

    it is possible to build managed applications directly in PB but please be aware that you'll loose all of the nice editer features like syntax highlightning and code completion.

    For one of our projects we wrote a couple of small C# utilities and included the build process directly into the build process of the OS Design.

    Before I give you the details on how we managed to handle the C# projects, let me state that in the end we moved back to including the compiled binaries into the OSDesing using the way that Bruce and Paolo mentioned.

    To build a managed application directly in PB start by creating a new empty subproject.

    Below is an example SOURCES file for a C# .NET CF3.5 managed application named SmartDeviceProject1.

    COMMONPUBROOT=$(_PROJECTROOT)\cesysgen
    __PROJROOT=$(_PROJECTROOT)
    RELEASETYPE=LOCAL
    TARGETNAME=SmartDeviceProject1
    TARGETTYPE=MANAGED_EXE
    
    _MANAGED_FRAMEWORK_DIR=$(_WINCEROOT)\OTHERS\DOTNETV35\MANAGED
    MANAGED_REFERENCES= $(_MANAGED_FRAMEWORK_DIR)\mscorlib.dll;$(_MANAGED_FRAMEWORK_DIR)\System.dll;$(_MANAGED_FRAMEWORK_DIR)\System.Data.dll;$(_MANAGED_FRAMEWORK_DIR)\System.Drawing.dll;$(_MANAGED_FRAMEWORK_DIR)\System.Windows.Forms.dll;$(_MANAGED_FRAMEWORK_DIR)\System.XML.dll 
    
    CSC=$(WINDIR)\Microsoft.NET\Framework\v3.5\csc.exe
    URT_VER=3.5
    MANAGED_FRAMEWORK_VERSION_DESKTOP=v3.5
    FILE_VIEW_ROOT_FOLDER= \
      ReadMe.txt \
      prelink.bat \
      postlink.bat \
    
    FILE_VIEW_RESOURCE_FOLDER= \
      Resources.resx \
      Form1.resx \
    
    FILE_VIEW_INCLUDES_FOLDER= \
    
    SOURCES= \
      Resources.Designer.cs \
      AssemblyInfo.cs \
      Form1.cs \
      Form1.Designer.cs \
      Program.cs \
    
    POSTLINK_PASS_CMD=postlink.bat
    PRELINK_PASS_CMD=prelink.bat
    FILE_VIEW_PARAMETER_FOLDER= \
      SmartDeviceProject1.bib \
      SmartDeviceProject1.reg \
      SmartDeviceProject1.dat \
      SmartDeviceProject1.db \
      ProjSysgen.bat 

    The first few entries in the SOURCES file are important.

    A TARGETTYPE of MANAGED_EXE tells the build system to generate a managed appliaction.

    The entries below TARGETTYPE define the path to the compiler tool chain and set the .NET CF version to 3.5

     

    I remember that we ran into problems with an application that had embedded resources. I was not able to solve how to compile the resources using PB. In the end I took the compiled version and included it into the subproject as file and used

    MANAGED_LINKRESOURCES=Resources.resources

    to link the resources to the application.

    HTH,

    Bjoern

    Monday, November 8, 2010 10:09 AM