sanvlr12 / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
0 stars 0 forks source link

Binaries Namespaces Incompatible with Mono #176

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new C# Console Project in MonoDevelop
2. Add References to Google.Apis.dll and Google.Apis.Plus.v1.dll (assuming the 
first is needed in everything)
3. Add using statement:
using Google.Apis.Plus.v1;
4. Write the line:
PlusService svc = new PlusService();
5. Build project

What is the expected output? What do you see instead?
Expecting project to compile, but instead it has compiler errors.

/home/me/Projects/testMono/testMono/Main.cs(25,25): Error CS0246: The type or 
namespace name `PlusService' could not be found. Are you missing a using 
directive or an assembly reference? (CS0246) (testMono)

What version of the product are you using? On what operating system?
google-api-dotnet-client-1.1.4344-beta.binary.zip
Ubuntu 11.10
Mono 2.10.5
MonoDevelop 2.6

Please provide any additional information below.
This is essentially identical to an older issue I reported when just trying to 
use the Samples projects in Mono.

http://code.google.com/p/google-api-dotnet-client/issues/detail?id=152

Thankfully this seems to have been fixed for those binaries, but only a few of 
the service libs are packaged there now (no G+).

The references are clearly there, the using statements are all clearly there. I 
can see the PlusService class when I view the dll in the Assembly Browser. Even 
MonoDevelop has no issues BEFORE you hit Build the first time and will assist 
with code completion. What is it that continually makes certain binaries 
incompatible with Mono? It seems whatever was done previously in terms of 
issue=152 would likely work in this situation as well.

Also this has nothing to do with the "Mono Compatibility" issues listed on this 
page.
http://code.google.com/p/google-api-dotnet-client/wiki/MonoCompability

I already have OAuth setup and working (which is why I don't mention it at all, 
just trying to use the service once one has an access token), however when 
actually trying to do something I came across this.

Original issue reported on code.google.com by fluxdr...@gmail.com on 21 Dec 2011 at 6:20

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. It is a problem related to the project definition, 
the assembly locations and the dependencies. If you copy all of the binaries 
(including the dependencies) to your project runtime directory, mono should 
find them. What I did to solve the problem with the samples was to include the 
generated .cs files instead of a reference to the binary (dll) for the service 
reference. This workaround should solve your problem as well.

I am lowering the priority of this issue, as there is a fairly good workaround. 
Let me know if you think the workaround doesn't meet your needs and the 
priority should be raised.

Austin Skyles

Original comment by asky...@google.com on 21 Dec 2011 at 6:44

GoogleCodeExporter commented 9 years ago
I see, so it's just a dependency issue that Mono isn't resolving. And also not 
giving a useful error as to which dependency it can't find.

It might be a good idea to better document which libraries are necessary 
dependencies for which Services. I'll see if I can't figure out which ones are 
the basic necessities I need and report back.

Original comment by fluxdr...@gmail.com on 21 Dec 2011 at 7:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hmm got it to work. I still only used Google.Apis.dll and 
Google.Apis.Plus.v1.dll (Newtonsoft.Json as well) but dropped them in a local 
directory for the project and Referenced those copies instead. Now compiles.

Never had this issue before though, with MonoDevelop referencing external 
dependencies. The strange thing is even before when I was referencing them from 
another path it would copy the dll's to the /bin folder (as it should), but 
just wouldn't compile.

Original comment by fluxdr...@gmail.com on 21 Dec 2011 at 8:19

GoogleCodeExporter commented 9 years ago
I agree, it's very strange. I think this is an issue with monodevelop so I 
think I will close this issue from our end.

Original comment by AustinSk...@gmail.com on 21 Dec 2011 at 9:55

GoogleCodeExporter commented 9 years ago

Original comment by asky...@google.com on 21 Dec 2011 at 9:56