[libRETS-users] Librets x64 Visual Studio issue

409 views
Skip to first unread message

Agustin Garzon

unread,
Feb 6, 2014, 8:47:31 AM2/6/14
to libret...@crt.realtors.org
Hey there guys. I'm a librets user for a long while now. 

Been running 1.5.2 x86 for ages, since recently I've been trying to flip to the x64 version in order to keep it running with other binaries not compatible with 32 bits. 

When I install the x64 binaries for either 1.5.2 or 1.5.3, the application runs, nonetheless, Visual Studio is not detecting it, it's not even trying to compile, complaining the namespace "librets" does not exist. 

When I replace the 2 .dll files with the x86 version of 1.5.2 or 1.5.3 Visual Studio 2013 has no problems, so you see my predicament, do you have any clue as to why is this happening ? 

The VS project is a website targeting .NET 4.5

Let me know if you have some clues ! Thanks a lot :)

--

Agustin.

Mark Klein

unread,
Feb 7, 2014, 10:34:12 AM2/7/14
to For discussion and help for and by the users of the libRETS C++ library
On Feb 6, 2014, at 5:47 AM, Agustin Garzon wrote:

> When I install the x64 binaries for either 1.5.2 or 1.5.3, the
> application runs, nonetheless, Visual Studio is not detecting it,
> it's not even trying to compile, complaining the namespace "librets"
> does not exist.

You're delving into areas where I have no expertise and hopefully
someone with more Windows/Visual Studio experience (hi Lynn) will
speak up. I only ever use the Command Line tools when I'm building
libRETS for Windows. So, maybe you can help educate me:

What do you mean when you say Visual Studio is not detecting it? Is
there a mode where you can say "target _this_ version .NET vs. _that_
version of .NET"? If so, can you target earlier versions of .NET and
have it show up then? IIRC, when I build the libraries, there is some
metadata that must be included and I'm wondering if maybe there is a
versioning thing going on? Will it fall back to an older version
of .NET?

I seem to recall that there was an issue with the way .NET 4.x was to
be targeted (there is an open ticket for 4.0 targeting) that may be
affecting you, especially if "the application runs,
nonetheless ......". That ticket is out of the scope of what I've been
funded to do for the next libRETS release, but if whatever is needed
is reasonably simple ... I may try to resolve it now.

Regards,


M.



_______________________________________________
libRETS-users mailing list
libRET...@crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users

David Bills

unread,
Feb 7, 2014, 1:10:45 PM2/7/14
to For discussion and help for and by the users of the libRETS C++ library
Here's my simple 1.5.2 setup, although I use the x86 binaries:

Copy both dll's to your source directory.
Include the pinvoke dll. Set Copy to Output Directory to Copy always.
Reference the dotnet dll. Set Copy Local to True.

I haven't used x64 simply because I haven't found a vendor yet whose server allows more than 5000 records and _reliably_ delivers that many records.

Dave Bills
Contact phone 719-749-1147
http://cp.mcafee.com/d/k-Kr6x0p6h0SyOqekhPMVdMsrKrpppvhpj76SmmnQmn1NJ6WrPPXdTAPrbbbBS7XCQ24zPW0FproY01dHbr7w09JeW3H3Gr_nVByXzWbDnKnhhd7b7fLCzBVcQsEYJteOaaJTA-l3PWApmU6CQjq9K_cKnLuZXTKrKr01yvmzfE_FYWNFM071dnoovaAVgtHxYy4vDgKTjUQdDO8h-t2XtfzgKgGT2TQ1lEPWfWveIqs01dI6zCXNI5-Aq83iSv8w2NE4z1tKDNEqnjh05p48_exEw3T63h06pkrQYQg34SQ9ld44GkrYS-yr767T

Agustin Garzon

unread,
Feb 13, 2014, 8:39:59 AM2/13/14
to For discussion and help for and by the users of the libRETS C++ library
I built 2 test projects, one for testing within vs2012 and one for vs2010, both projects target .NET 4.5
Here are the results:


Librets 1.5.2 on Visual Studio 2010
------------------------------------------
x86 is added ok, and is properly interpreted by VS, offering intelisense* It also compiles.
(what I mean by "interpretes" is that VS validates the assembly, and identifies and allows the coder to reference the types within the library)

x64 is added ok, and is properly interpreted by VS, offering intelisense. It will not compile, throwing this error:
"An attempt was made to load a program with an incorrect format"

This issue happens when the library is compiled targeting a specific cpu, perhaps it should be changed to target "Any CPU", that's at least how it could be done on Visual Studio.

Librets 1.5.2 on Visual Studio 2012
------------------------------------------
x86 is added ok, and is properly interpreted by VS, offering intelisense. It also compiles.

x64 is not added ok, VS is unable to identify the library, it's like it's not there, so I can't reference any of the types, at least within Visual Studio. 


With Librets 1.5.3 I had similar results, although I don't have the x86, so I just tried the x64 version which produced the exact results as 1.5.2 on both versions of VS.


See, when I run this in the server, it works, it seems a VS thing, like it's not identifying the headers, or a bit-ness cpu compilation whatnot thing, which is crippling the development capabilities within VS.


I would like to NOT HAVE TO compile librets myself :)
And be able to reference the x64 assemblies within newer versions of VS (2010-2012) like I do with the x86 version. 

Wonder how come no one else faced this issue before ? 

I'm willing to help testing different compilations on my vs2010 and vs2012 projects, to see which one works.

Thanks for your support 

--

Agustin.

"You only need to change your direction," said the cat, and ate it up.

Michael Granovski

unread,
Feb 13, 2014, 11:39:47 AM2/13/14
to library
I plugged dlls correctly in c#. But getMetadata generate exception.
The session login was success.

Mark Klein

unread,
Feb 13, 2014, 12:35:47 PM2/13/14
to For discussion and help for and by the users of the libRETS C++ library
On Feb 13, 2014, at 5:39 AM, Agustin Garzon <agu...@bluetonemedia.com> wrote:

> x64 is added ok, and is properly interpreted by VS, offering intelisense. It will not compile, throwing this error:
> "An attempt was made to load a program with an incorrect format"

That usually means something is 32 bit in the build chain. Please do this on the librets dlls and look for the
"machine" line if you don't have grep:

$ dumpbin /headers librets-pinvoke.dll | grep machine
8664 machine (x64)

$ dumpbin /headers librets-dotnet.dll | grep machine
8664 machine (x64)

If they're x64, then the other possibility may be credentials. I recall there being an issue about signed
vs. unsigned stuff (and that it was easier to self sign than to remove the credentials of a signed dll).
You might need to self sign things if you're running in a more secure environment.

Mind you … I'm not a Windows developer (I only have Macs and a lone FreeBSD server here), but I do
run a Windows 7 instance in a VM just to build the libRETS Windows DLLs. My testing is cursory: the
provided demo applications must work, and that's about it. So, I verify that logging in, fetching metadata
and a simple search work on Windows before I release it. That's the extent of my Windows skills at this point.

If there is a "real" Windows user that wants to help better support this, please reach out to me … I'll be
happy to use the help.

> I would like to NOT HAVE TO compile librets myself :)
> And be able to reference the x64 assemblies within newer versions of VS (2010-2012) like I do with the x86 version.

Trust me … it is a pain in the @ss. It's not just libRETS that must be built, but the supporting libraries it uses as
well: boost, curl, expat, openssl, etc.

> I'm willing to help testing different compilations on my vs2010 and vs2012 projects, to see which one works.

My Windows build VM is using the 2010 version of the SDK - I don't have the full Visual Studio and have never
used it, so I'm at a loss here.

I may explore building with the latest SDK, but if that breaks my current environment, then I'll revert to the current
snapshot and SDK to get the librets 1.6.x release out using the 2010 SDK.

Keith T. Garner

unread,
Feb 13, 2014, 2:04:47 PM2/13/14
to For discussion and help for and by the users of the libRETS C++ library
On Feb 13, 2014, at 11:35 AM, Mark Klein <lib...@dis.com> wrote:
> I may explore building with the latest SDK, but if that breaks my current environment, then I'll revert to the current
> snapshot and SDK to get the librets 1.6.x release out using the 2010 SDK.

To get ready to update ezRETS to match libRETS update, I've started building a new Windows dev machine. Strangely, I couldn't get VS C++ 2010 Express to install, but VS C++ 2013 Express did. I haven't gotten far enough along yet to try to the build of libRETS, but I'll keep you posted.

Keith

--
Keith T. Garner - kga...@realtors.org - 312-329-3294 - http://realtor.org/
National Association of REALTORS® - VP - Information Technology Services

Agustin Garzon

unread,
Feb 13, 2014, 2:30:38 PM2/13/14
to For discussion and help for and by the users of the libRETS C++ library
I can test your x86 and x64 builds. Keep me posted on this regard, thanks !
Reply all
Reply to author
Forward
0 new messages