Unable to load RCFProto

RCFProto support and general discussion.
Post Reply
20039001
Posts: 4
Joined: Fri Nov 15, 2013 10:00 am

Unable to load RCFProto

Post by 20039001 »

whem i building client-server C#(csharp) demo application in VS 2008 at RCFProto.Init(); line i am getting "unable to load PCFproto native binding for .Net Attempted to lead RCFProto_NET_impl.dll LoadLibraryEx() error :The specified module could not be found "

i intstalled Microsoft Visual C++ 2008 Redistributables x86 resolve missing msvcr100 dllerror and i changed project properies to x86 . still i am getting the same error still .

can please do needful as possible

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Unable to load RCFProto

Post by jarl »

Can you give us some more details about your environment? Are you able to build and run the demo that is in the distribution?

I've downloaded RCFProto-win32-0.9.0.6.zip, opened csharp/demo/vs2008/RCFProtoDemo.sln in Visual Studio 2008, built the solution and have verified that I can run the DemoServer and DemoClient projects.

In your own projects, you will need to deploy RCFProto_NET.dll, Google.ProtocolBuffers.dll and RCFProto_NET_impl.dll. You will need to select the correct version of RCFProto_NET_impl.dll (32 bit or 64 bit, depending on the architecture of the loading executable), and RCFProto_NET_impl.dll should generally be in the same directory as the loading executable. If you have RCFProto_NET_impl.dll in a location which the Windows DLL loader can't find, you will need to call RCFProto.SetNativeDllPath() , with the relevant path to RCFProto_NET_impl.dll, before you call RCFProto.Init().

There is more information available in the RCFProto User Guide:

http://www.deltavsoft.com/RCFProto/doc/ ... quirements
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

20039001
Posts: 4
Joined: Fri Nov 15, 2013 10:00 am

Re: Unable to load RCFProto

Post by 20039001 »

Hi jarl,

Thanks for your suggestion

I followed below mentioned steps to build RCFProtoDemo application

Step1 : I have Downloaded RCFProto-win32-0.9.0.6.zip.

Step2 : opened csharp/demo/vs2008/RCFprotoDemo.sln in visual Studio 2008

Step3 :Before building RCFProtoDemo Solution. I have generated Demo.CS file from ProtoGen.exe which is located csharp\demo\vs2008\bin\Debug using

command ProtoGen.exe Demo.Proto -Service_generator_type=GENERIC __output_directory=.

Step4 :Added Demo.cs file to both DemoClient and DemoServer projects.

Step5 : Deployed(Added) Google.ProtocolBuffers and RCFproto_Net DLLs for both DemoClient and DemoSever Projects.

Step6 :As you suggested set Native DLL path for RCFProto_NET_impl before calling RCFProto.Init() function
as mentioned below

RCFProto.SetNativeDllPath("E:\\Protobuf\\RCFProto-win32-0.9.0.6\\RCFProto-win32-0.9.0.6\\csharp\\demo\\vs2008\\bin\\Debug\\x86\CFProto_NET_impl.dll");

Step7 : Build the RCFProtoDemo solution and Build Succeeded.

Step8 :At RCFProto.Init() i am getting following Exception

"\Unable to load RCFProto native bindings for .NET. Attempted to load:
E:\\Protobuf\\RCFProto-win32-0.9.0.6\\RCFProto-win32-0.9.0.6\\csharp\\demo\\vs2008\\bin\\Debug\\x86\\RCFProto_NET_impl.dll.\nLoadLibraryEx()
error: %1 is not a valid Win32 application\nN...

if any Steps i missed ,please correct me where i am going wrong

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Unable to load RCFProto

Post by jarl »

You're almost there... The last error ("%1 is not a valid Win32 application") indicates a x86/x64 mismatch between the loading application and RCFProto_NET_impl.dll. It looks like you have provided the path to the x86 version of RCFProto_NET_impl.dll - can you try with the path to the x64 one instead?

Regarding the C# demo in the distribution, you don't need to run ProtoGen.exe yourself, as there are pre-build commands in the project that will do that for you. Once you've built the solution, you don't need to copy any DLL's anywhere - just run DemoServer and DemoClient directly from Visual Studio,and they will locate the DLL's they need.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

20039001
Posts: 4
Joined: Fri Nov 15, 2013 10:00 am

Re: Unable to load RCFProto

Post by 20039001 »

Hi jarl,

When i refer x86 DLL i will get exception at RCFProto.Init() saying that
"Unable to load RCFproto native binding for .NET Attempted to load E:\\Protobuf\\RCFProto-win32-0.9.0.6\\RCFProto-win32-0.9.0.6\\csharp\\demo\\vs2008\\bin\\Debug\\x86\CFProto_NET_impl.dll LoadLibraryEx error :the Specified module could not be found "


When i refer x64 DLL i will get exception at RCFProto.Init() saying that
"Unable to load RCFproto native binding for .NET Attempted to load E:\\Protobuf\\RCFProto-win32-0.9.0.6\\RCFProto-win32-0.9.0.6\\csharp\\demo\\vs2008\\bin\\Debug\\x64\CFProto_NET_impl.dll LoadLibraryEx error :the Specified module could not be found "LoadLibraryEx() error: %1 is not a valid Win32 application. Note: This error most likely indicates an x86/x64 architecture mismatch.

Please suggest me how can i fix this issue
-

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Unable to load RCFProto

Post by jarl »

OK, it looks like you need to be using the x86 DLL them. The error message you're getting ("Specified module could not be found") is most likely due to a missing dependency.

Because we built RCFProto_NET_impl.dll with Visual Studio 2012, you need to have the Visual Studio 2012 runtimes installed. The runtimes can be downloaded here:

http://www.microsoft.com/en-au/download ... x?id=30679

, and you'll want to download vcredist_x86.exe .

Once you've installed that, you should be able to load RCFProto_NET_impl.dll.

Thanks for persisting with this.The dependency on the Visual Studio runtimes is not clearly stated in the documentation, and we'll fix that.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Unable to load RCFProto

Post by jarl »

On a further note, if you still get load errors, you can download the Depends utility:

http://www.dependencywalker.com/

, and then run that on x86\RCFProto_NET_impl.dll . If there are any dependencies missing, it will tell you what they are.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

20039001
Posts: 4
Joined: Fri Nov 15, 2013 10:00 am

Re: Unable to load RCFProto

Post by 20039001 »

Hi Jarl,

With respect to usage of RCFProto libraries, is it compulsory to have RCFProto both Server and Client sides?

I have written a C# Client with RCFProto library to communicate with already running C++ server (RPC Service with Protbuff implementation).
For this I have used the same .proto(used in Server with C++) file for generating cs files.

Following are the issues I am facing:

Client(C#) Side i am getting RCF Error:Decoder Error.
Server(C++) side i am getting out of memory.

Appreciate any suggestions on this issue:.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Unable to load RCFProto

Post by jarl »

Currently RCFProto embeds its Protocol Buffer serialized objects in the RCF protocol, which in practical terms means you will need both server and client to be RCFProto-based. We are however looking at using a HTTP-based protocol instead, to allow for more interoperability.

Re the issues you have - can you reduce your code down to a sample that we can run here? Do you have stack traces for the two errors (client-side and server-side)?

Off hand it looks like there is something wrong with the format of the bytes coming across the wire.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply