Error CS0246 for RegistryDesktop.dll

numerus

Member
Licensed User
Hi,
When I use the NON-optimized compilation (B4PPC ver. 6.30) there are no problems and next my app works fine on the device. However when I use the optimized compilation, I get the following error – Error CS0246: The type or namespace name ‘RegistryDesktop’ could not be found …...

I removed all registry functions from the application, as well RegistryDesktop.dll and RegistryDevice.dll from components. Next I tested the optimized compilation – in this case the compilation was successful.
So, it seems to me the problem is with RegistryDesktop. Where is my mistake in using it in optimized compilation? In fact I don’t need this one for device application but it should be as the component for compilation on the PC.

Can someone tell me what is missing ?
Thanks
 

agraham

Expert
Licensed User
Longtime User
I can't reproduce your error message. The closest I can get is "Error CS0246: The type or namespace name ‘Registry’ could not be found …... " This occurs when RegistryDesktop is added to the Desktop but Registry is NOT added to the device and a device compilation is attempted. Registry is required for device compilation even if it is not used if the desktop has RegistryDesktop added as a component.

If this is not your scenario then post the code that fails to compile so we can see what is wrong with it.

The rule for optimised compilation is that desktop applications don't need the equivalent library added to the device but device applications DO require the equivalent library added to the desktop. This is because the optimising compiler uses the desktop libraries as a reference even when compiling for the device.
 
Top