Home > Back-end >  Namespace or type specified doesn't contain any public member or cannot be found
Namespace or type specified doesn't contain any public member or cannot be found

Time:02-26

I've working on project in vs2005, to make compact framework app to be launched under wince 6.0. In order to do that, I created the new project for the smart device.

creation of a new sda project

enter image description here

then I added a reference EasyModbus.dll.

enter image description here

Prior to this I copied the "EasyModbus.dll" file into the folder with project. Furthermore I added some code intending to Import the methods of this DLL into this project. When typing statement "Imports EasyModbus" I was surprised on having complained about error:

Namespace or type specified in the ImportsEasyModbus doesn't contain any public member or cannot be found. Make sure the namesppace or the type is defined and contains at least one public member. Make sure the imported element doesn't use any aliases

enter image description here

Could anyone kindly provide any suggestions, even very general and vague on possible reasons causing of emerging the error above?

CodePudding user response:

"... Prior to this I copied the "EasyModbus.dll" file into the folder with project. Furthermore I added some code intending to Import the methods of this DLL into this project. ..."

I assume EasyModBus.dll is NOT a .NET CompactFramework library. I am not sure, as you did not rpovide details about "...added some code to import methods...". If EasyModBus.dll is a native Windows CE and processor compatible DLL, then you normally use [DLLImport("EasyModBus.dll")] and then declare the native functions wrapped in .NET code. Ie:

[DllImport( "user32.dll" )] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool EnumWindows( EnumWindowsProc lpEnumProc, IntPtr lParam );

If you can provide the DLL, I can look at and say if it is a .NET or native one.

CodePudding user response:

The Hello World application, I've created in VS2005 targeting compact framework 2.0 normally launches under emulator, also on my PC. Thus I went Build ---> Build DeviceApplication1. The application 'DeviceApplication1.exe' was built. Then I copied it on SD card of target PLC with use of CER-host I reach the desktop of Win CE 6.0 find the application file and tried to launch 'DeviceApplication1.exe', but it failed to launch, though none of error reports have been generated by the Win CE 6.0. Could anyone kindly take me to understanding, generally, what would be possible reasons of failing the application to launch on actual target device?

  • Related