views:

53

answers:

1

I'm trying to include the YouTube Search in one of my .NET applications with framework Version 4.0. Unfortunately, the GData .NET Library currently only supports .NET 2.0. Is it possible to get around this limitation, possibly by writing something like a "wrapper" or by using another library that is not too distinct from the original one?

+1  A: 

Unless there's any native code in there (which I doubt) I believe you should be able to add a reference to the library anyway.

If not, why not just download the source and rebuild it targeting .NET 4? Having said that, please give details about the difficulties you're having adding a reference to it, and I'll talk to the relevant person to see if we can get an updated official binary release available too. (No promises though.)

EDIT: I just downloaded the source tar.gz file, unloaded the unit test project (just to avoid having to find the right dependency), build the DLLs, copied everything from the YouTube directory into a new .NET console app (the full framework, not the client profile btw - might that be what was wrong?) and it's built fine.

EDIT: I've just tried changing it to the "client only" profile and I get the same warnings as you mention. So it's simple: just go into the project properties of your .NET 4 app, and in the Application tab, for "Target Framework" select ".NET Framework 4" - all should then be well. You should be able to use the original assemblies too, without rebuilding them yourself.

Jon Skeet
I tried to recompile the source brought with the version 1.6 and got the same error as with the prebuild libraries when compiling the project after setting the references: The referenced assembly "Google.GData.Extensions, Version=1.6.0.0, Culture=neutral, PublicKeyToken=0b4c5df2ebf20876, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, ..."I will now try building the source from the SVN directly. (hit enter too early, sorry)
UncaughtException
@UncaughtException: It sounds like you just need to add a reference to System.Web as well... trying it myself now. And what happened when you tried to just use the binaries in the first place?
Jon Skeet
Thank you so much, it was exactly what you said: I had the "client only" profile on, I didn't really knew what the difference was, as I'm just beginning to learn .NET. Now everything is working fine, no new binary necessary. But thanks for that too!
UncaughtException