Studio ’08’s Toolbox and Compact Framework Assemblies

A major player in our very, very late delivery of version 2.3 of the Smart Device Framework turned out to be problems with toolbox integration in Visual Studio 2008.  The process of automating the install itself isn’t well documented, so it took a while to determine that we weren’t actually doing anything wrong, but instead that we were uncovering bugs and limitations in Visual Studio itself.

There are two problems every CF developer needs to be aware of (and I really hope Microsoft will publish a KB article on these to help get the word out):


  1. Controls built against CF 2.0 will not show up in the toolbox for CF 3.5 projects.  Period.  There is absolutely no way to make them show up.  So if you want your control to be available in the toolbox for CF 2.0 and CF 3.5 projects, you must build and deploy two versions of your control.  This appears to be “by design,” though I’d argue a seriously flawed design.

  2. To compound the problems caused by #1, there is a serious bug as well.  If your control uses the Microsoft.WindowsCE.Forms assembly, then you cannot add it to the CF 3.5 toolbox.  The toolbox accepts CF 2.0 controls using it, but CF 3.5 controls will always throw an exception in Studio.  Even worse, if you have several controls in a single assembly and just one of them uses Microsoft.WindowsCE.Forms, then none of the controls in the assembly can be added to the Toolbox.

So what does this mean to SDF users?  Well nothing good.  We first tried to work around “feature” #1 by building and deploying two SDF assemblies for our controls.  It’s not very maintainable, and it’s painful, but we spent a good week getting our new automated build scripts to generate the necessary assemblies, CAB files and deployment manifests.  After all that, we found bug #2, so even though we had the 3.5 assembly, it was unusable.

This means that, unless Microsoft releases changes to Visual Studio or we remove several controls from the SDF, you will not have Toolbox support for SDF controls with Compact Framework 3.5 projects in Studio 2008.  We regret that fact and apologize to our users, but there’s simply nothing we can do about it at this point.  What we may do (I’m not saying this *is* what will happen, only what we’re considering at this point) is split the OpenNETCF.Windows.Forms.dll assembly up to pull CF 3.5 Toolbox supportable controls out, but that’s going to break references and make deployment and nasty business.

So if you’re an SDF user and you’d like to use the SDF Controls in your CF 3.5 toolbox we encourage you to not open a bug with us, but instead open a support case with Microsoft.  Remember, if you open a case with them and it turns out to be a bug, the support incident is free.  What it does, however, is give them some insight into the number of customers that the bugs actually affect, and hopefully will give them some incentive to release a fix for these problems before 2010.


Note: One semi-kludgy way to get the Controls to show up is to start the project as a 2.0 project and drop them on the Form, then upgrade the project to 3.5.  It seems that the designer itself can handle the objects, it’s just that the Toolbox can’t.


6 thoughts on “Studio ’08’s Toolbox and Compact Framework Assemblies”

  1. I have not been able to get the controls into the toolbox for 2.0 builds either. They do not appear in the WinMedia player sample either.

    Eric

    Like

  2. I am pulling my hair out with this…
    I am new to all this so this hurdle is so not helping me…How the heck do I get this in the toolbox?

    I have managed to build my solution for VB with no problems… but I need it on windows mobile not windows… hence here I am, I too have tried 2 and 3.5

    Are you able to help please Chris?

    Like

  3. I am pulling my hair out with this…
    I am new to all this so this hurdle is so not helping me…How the heck do I get this in the toolbox?

    I have managed to build my solution for VB with no problems… but I need it on windows mobile not windows… hence here I am, I too have tried 2 and 3.5

    Are you able to help please Chris?

    Like

  4. My work-around is this:

    1. I add an additional SmartDevice project to my solution that uses CF 2.0 and call it "OpenNetCFControls".
    2. I then create a new form called "OpenNetCF Controls" to that 2.0 project that has all the OpenNetCF controls on it using drag/drop.
    3. When I need an OpenNetCF control in my 3.5 solution, I COPY it from the "OpenNetCF Controls" form in my 2.0 project
    and paste it onto the form in my 3.5 project. Works nicely

    Yes – it is also "semi-kludgy" as Chris puts it, but it is practical and the ongoing development time of copy/paste is not that much slower than dragging a control onto the form from the Toolbox.

    Joe Hanna
    http://www.vantageit.com.au

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s