Search code examples
c#.netgoogle-voice

Compiling a C# .NET Application with a Google Voice API


From scouring the internet I managed to find an apparently working "Google Voice API". Which is great! I'm working on an application that detects when a server process crashes / errors out and then notifies me through text. It'd be really useful because the server isn't totally reliable and on occasion needs a reset and sometimes I'm too lazy to get off my ass from the couch / busy doing something else.

Anyway, the API:

http://sourceforge.net/projects/gvoicedotnet/

I added the dll as a reference and everything loaded up well with intellisense. I added the dll into my .cs (using using [haha]). After everything was added I decided to compile just to make sure it would compile, and of course it didn't.

The Error:

Error 201 The type or namespace name 'Google' could not be found (are you missing a using directive or an assembly reference?)

Anyway, for some reason at every compile it removes the dll as a reference? The only thing that seems to be somewhat of an indicator (which I doubt is involved) is this warning

The referenced assembly "Google.Voice.Service, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

tl;dr reference keeps automatically becoming unreferenced.


Solution

  • You need to change your target framework to the full .Net 4 framework and then add a reference to System.Web.