Cs0234

mikewhite

Member
Licensed User
Longtime 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
 

mikewhite

Member
Licensed User
Longtime 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
 

mikewhite

Member
Licensed User
Longtime 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
 

agraham

Expert
Licensed User
Longtime 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.
 

mikewhite

Member
Licensed User
Longtime 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
 

agraham

Expert
Licensed User
Longtime 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.
 

mikewhite

Member
Licensed User
Longtime 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
 

agraham

Expert
Licensed User
Longtime 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!
 

mikewhite

Member
Licensed User
Longtime 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
 

mikewhite

Member
Licensed User
Longtime 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
 

agraham

Expert
Licensed User
Longtime User
Will I be heading for trouble later this way though?
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.
 

Erel

B4X founder
Staff member
Licensed User
Longtime 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.
 

mikewhite

Member
Licensed User
Longtime 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
 
Top