Cs0234

Discussion in 'Questions (Windows Mobile)' started by mikewhite, Aug 14, 2008.

  1. mikewhite

    mikewhite Member Licensed User

    Hi,

    I'm trying to compile a very simple (device) program but get an Error popping up, saying:

    CS0234: The type or namespace name 'WindowsCE' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    This starts to happen when I add the ControlsEXDevice.dll to the project.

    Any help appreciated please!

    Thanks

    Mike White
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. mikewhite

    mikewhite Member Licensed User

    Erel,

    I extracted these to ...\Anywhere Software\Basic4ppc Desktop\Libraries

    is that correct?
    I still get the error but I notice I only get it if I have the option "Optimized Compilation" checked.

    Mike
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You should also replace the dll files that are located in the source code folder.
     
  5. mikewhite

    mikewhite Member Licensed User

    I tried that but still no luck.

    What I have found is that if I use ControlsEXDeviceDummy on the Device side the program compiles and runs (I'm using a DateTime Picker at the moment).

    Is that what I should have been doing?

    Mike
     
  6. agraham

    agraham Expert Licensed User

    You should have ControlsExDeviceDummy as the desktop component and ControlsExDevice for the device. If you have not had the dummy or the "real" library as a component on the desktop this may be why the compiler fails as it picks up information from the desktop library even when compiling for the device.
     
  7. mikewhite

    mikewhite Member Licensed User

    Thanks for that. But to confirm:

    If I have ControlsEXDevice on the Device Side and ControlsEXDeviceDummy on the desktop I get the compile error.

    If I have ControlsEXDeviceDummy on the Device side it compiles.

    The odd thing is, I think this worked yesterday :/

    Perhaps I will try to uninstall and reinstall Basic4ppc but I'm not sure that will help.

    I have no other Components set at all, just these.

    Thanks again,

    Mike
     
  8. agraham

    agraham Expert Licensed User

    Can you compile the ControlsExDeviceDemo app that comes with the library?

    P.S. If you are wondering why I've jumped into this thread it's because I wrote those libraries and they compile fine on my machine - and other peoples - so I don't think there is anything intrinsically wrong with the library code.
     
  9. mikewhite

    mikewhite Member Licensed User

    No,

    that program does not compile either - same error. There must be something wrong with the setup on my machine. Likely in the .net stuff somewhere.
    Any idea where I could start to look?

    Thanks for jumping in, by the way, all help appreciated.

    Mike
     
  10. agraham

    agraham Expert Licensed User

    @Erel. Does he need to have installed CF 2.0 on the device to get his desktop updated with the CF assemblies used by the C# compiler? The CF 2.0 redistributable is so huge that I assumed it had bits for the desktop SDK included as well - but I don't really know!
     
  11. mikewhite

    mikewhite Member Licensed User

    Well, I've uninstalled Basic4ppc and all references to .Net Frameworks.
    I've now re-installed .Net Framework 1 and 2 and .Net Compact Framework 2 and Basic4ppc. Still the same error message.

    Mike
     
  12. agraham

    agraham Expert Licensed User

    Sorry but I am baffled :confused: I'll think on.
     
  13. mikewhite

    mikewhite Member Licensed User

    Well, I can't get to bothered at the moment. If I leave the Dummy file in the device side the program compile and builds with a DTP which is what I want at the moment. That is, it runs on a real device.
    Will I be heading for trouble later this way though?

    Thanks

    Mike
     
  14. agraham

    agraham Expert Licensed User

    Time (and whether other libraries work) will tell!

    @Erel - in case it it a clue! Both dummy and device libraries are compiled in VS2005 for WM2003 and CF 2.0. The difference, aprart from coding, is that the device version additionally references Microsoft.WindowsCE.Forms to use the device Notifier. Presumably it is this reference that causes the problem, but why I have no idea.
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    The simplest solution is to add SIP(True) or SIP(false) somewhere in your code.

    The reason for this is a bit complex.
    If you'll delete the source code ControlsExDevice.cs from Basic4ppc libraries folder it will also work.
    However when the compiler sees this file (and you have a reference to ControlsExDevice.dll) the compiler tries to merge it in the executable. Merging is done by compiling the code together with your code.
    To compile this library a reference to Microsoft.WindowsCE.Forms.dll is required.
    Basic4ppc doesn't add a reference to this library by default.
    Basic4ppc only adds a reference to this dll if it knows that this dll is needed.
    The SIP method requires a reference and therefore adding it will solve this problem.
    Another solution is to edit the LibrariesException.txt file (found under Basic4ppc folder).
    Basic4ppc v6.50 will be distributed with a modified LibrariesException file that will fix this problem.
     
  16. mikewhite

    mikewhite Member Licensed User

    Thanks Erel, I would *never* have figured it out for myself.

    I prefer to complie the enhanced way for the reduced exe size and no need to deploy the dlls.

    I'm happy again.

    Thanks too agraham for your help (and the library!)

    Mike
     
  17. agraham

    agraham Expert Licensed User

    Ahah! - well detected Erel :sign0188:

    I don't put my own sources in the libraries folder as it gets a bit crowded and I like to keep it for "official" libraries so I didn't see that.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice