Hi,

I was looking for the version number 9.0.0.0. My guess is that somehow
the ApplicationConfiguration values are not getting picked up
properly, so I need more background into how your particular sample is
running (web service/asp.net/windows service, etc.) Meanwhile, here's
how I did it for a vb.net console application in vs2008.

1. Created a new vb.net console application in vs2008.
2. Compiled google-api-adwords-dotnet.sln.
3. Made a lib\ folder inside Console Application\My Project\ and
copied google-api-adwords-dotnet.dll into it.
4. Copied App.config from src\ to Console Application\My Project.
5. Within Visual Studio, I added a reference in my vb.net project to
google-api-adwords-dotnet.dll and System.Web.Services
6. Added App.config to my vb.net project as Add Existing Item.
7. Changed my Module1.vb as follows:

Imports com.google.api.adwords.lib
Imports com.google.api.adwords.v201003

Module Module1

    Sub Main()
        Dim user As AdWordsUser
        Dim campaignService As CampaignService
        Dim page As CampaignPage

        user = New AdWordsUser
        campaignService =
user.GetService(AdWordsService.v201003.CampaignService)
        page = campaignService.get(New CampaignSelector())
    End Sub

End Module

8. In my App.config, I added my credentials as follows:

<add key="LogToFile" value="true"/>

<add key="CompanyName" value="XXX"/>
<add key="Email" value=...@gmail.com"/>
<add key="Password" value="XXXXX"/>
<add key="ClientEmail" value="client_1+...@gmail.com"/>
<add key="DeveloperToken" value="x...@gmail.com++usd"/>

<add key="LegacyAdWordsApi.Url" value="https://sandbox.google.com"/>

<!-- Uncomment this key if you want to use AdWords API sandbox. -->
<add key="AdWordsApi.Url" value="https://adwords-sandbox.google.com"/>

9. Built and ran my application.

If you want to make calls to production server, just comment out
AdWordsApi.Url and LegacyAdWordsApi.Url nodes in app.config, change
the credentials to the production credentials and you are all set to
go. Also, ClientEmail and ClientCustomerId as mutually exclusive, so
make sure you mention only one and comment out the other node in
app.config.

Hope this helps. Let me know if you have more questions and I can
answer them for you.

Cheers,
Anash P. Oommen,
AdWords API Advisor.
On Aug 7, 11:17 am, none <part...@activistmanager.com> wrote:
> I think I noted that I'm using the 201003 version of the API. I'm then
> building the Google provided solution and extracting the dll, which I
> then add a reference to in my actual project. When I add the google-
> api-adwords-dotnet.dll dll the version number is 9.0.0.0. Is any other
> sort of identifer you are looking for?
>
> What's very odd is that even though I set the reference to a dll, when
> it crashes I get the code break in the following set of code that
> isn't in the project or solution I'm working in. When I look at my
> list of references in Visual Studio it seems as if the reference path
> is not to c:\ when I have the DLL, but within the project itself.
> Don't know if that means anything.
>
>     private object[] Call(string methodName, object[] parameters) {
>       try {
>         if (HttpContext.Current != null) {
>           HttpContext.Current.Items.Add("AdWordsParent", this.Parent);
>           HttpContext.Current.Items.Add("SoapService", this);
>           HttpContext.Current.Items.Add("SoapMethod", methodName);
>         } else {
>           CallContext.SetData("AdWordsParent", this.Parent);
>           CallContext.SetData("SoapService", this);
>           CallContext.SetData("SoapMethod", methodName);
>         }
>         return base.Invoke(methodName, parameters);
>       } catch (SoapException ex) {
>         throw GetCustomException(ex);
>       } finally {
>         if (HttpContext.Current != null) {
>           HttpContext.Current.Items.Remove("AdWordsParent");
>           HttpContext.Current.Items.Remove("SoapService");
>           HttpContext.Current.Items.Remove("SoapMethod");
>
>         } else {
>           CallContext.FreeNamedDataSlot("AdWordsParent");
>           CallContext.FreeNamedDataSlot("SoapService");
>           CallContext.FreeNamedDataSlot("SoapMethod");
>         }
>       }
>     }
>
> Here's the exception detail
>
> System.Net.WebException was unhandled
>   Message=Unable to connect to the remote server
>   Source=System
>   StackTrace:
>        at System.Net.HttpWebRequest.GetRequestStream(TransportContext&
> context)
>        at System.Net.HttpWebRequest.GetRequestStream()
>        at
> System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters)
>        at com.google.api.adwords.lib.SoapServiceBase.Call(String
> methodName, Object[] parameters)
>        at com.google.api.adwords.lib.SoapServiceBase.Invoke(String
> methodName, Object[] parameters)
>        at
> com.google.api.adwords.v201003.CampaignService.mutate(CampaignOperation[]
> operations)
>        at Workshop.MainWindow.button5_Click(Object sender,
> RoutedEventArgs e) in XXXXX
>        at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object
> target, RoutedEventArgs routedEventArgs)
>        at System.Windows.EventRoute.InvokeHandlersImpl(Object source,
> RoutedEventArgs args, Boolean reRaised)
>        at System.Windows.UIElement.RaiseEventImpl(DependencyObject
> sender, RoutedEventArgs args)
>        at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
>        at System.Windows.Controls.Primitives.ButtonBase.OnClick()
>        at System.Windows.Controls.Button.OnClick()
>        at
> System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButt 
> onEventArgs
> e)
>        at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object
> sender, MouseButtonEventArgs e)
>        at
> System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
> genericHandler, Object genericTarget)
>        at System.Windows.RoutedEventArgs.InvokeHandler(Delegate
> handler, Object target)
>        at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object
> target, RoutedEventArgs routedEventArgs)
>        at System.Windows.EventRoute.InvokeHandlersImpl(Object source,
> RoutedEventArgs args, Boolean reRaised)
>        at System.Windows.UIElement.ReRaiseEventAs(DependencyObject
> sender, RoutedEventArgs args, RoutedEvent newEvent)
>        at System.Windows.UIElement.OnMouseUpThunk(Object sender,
> MouseButtonEventArgs e)
>        at
> System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
> genericHandler, Object genericTarget)
>        at System.Windows.RoutedEventArgs.InvokeHandler(Delegate
> handler, Object target)
>        at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object
> target, RoutedEventArgs routedEventArgs)
>        at System.Windows.EventRoute.InvokeHandlersImpl(Object source,
> RoutedEventArgs args, Boolean reRaised)
>        at System.Windows.UIElement.RaiseEventImpl(DependencyObject
> sender, RoutedEventArgs args)
>        at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs
> args)
>        at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args,
> Boolean trusted)
>        at System.Windows.Input.InputManager.ProcessStagingArea()
>        at
> System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
>        at
> System.Windows.Input.InputProviderSite.ReportInput(InputReport
> inputReport)
>        at
> System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd,
> InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x,
> Int32 y, Int32 wheel)
>        at
> System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr
> hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean&
> handled)
>        at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr
> hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
>        at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr
> wParam, IntPtr lParam, Boolean& handled)
>        at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
>        at
> System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
> callback, Object args, Int32 numArgs)
>        at
> MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
> source, Delegate method, Object args, Int32 numArgs, Delegate
> catchHandler)
>        at
> System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority
> priority, TimeSpan timeout, Delegate method, Object args, Int32
> numArgs)
>        at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32
> msg, IntPtr wParam, IntPtr lParam)
>        at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
>        at
> System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame
> frame)
>        at
> System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
>        at System.Windows.Threading.Dispatcher.Run()
>        at System.Windows.Application.RunDispatcher(Object ignore)
>        at System.Windows.Application.RunInternal(Window window)
>        at System.Windows.Application.Run(Window window)
>        at System.Windows.Application.Run()
>        at Workshop.Application.Main() in XXXX
>        at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
> String[] args)
>        at System.AppDomain.ExecuteAssembly(String assemblyFile,
> Evidence assemblySecurity, String[] args)
>        at
> Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
>        at System.Threading.ThreadHelper.ThreadStart_Context(Object
> state)
>        at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state, Boolean
> ignoreSyncCtx)
>        at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state)
>        at System.Threading.ThreadHelper.ThreadStart()
>   InnerException: System.Net.Sockets.SocketException
>        Message=No connection could be made because the target machine
> actively refused it 127.0.0.1:80
>        Source=System
>        ErrorCode=10061
>        NativeErrorCode=10061
>        StackTrace:
>             at System.Net.Sockets.Socket.DoConnect(EndPoint
> endPointSnapshot, SocketAddress socketAddress)
>             at System.Net.ServicePoint.ConnectSocketInternal(Boolean
> connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
> address, ConnectSocketState state, IAsyncResult asyncResult, Int32
> timeout, Exception& exception)
>        InnerException:
>
> Thanks,
>
> (Note that I submitted this question a second time when I thought the
> first had not gotton posted, please ignore second post)
>
> On Aug 3, 1:33 am, AdWords API Advisor <adwordsapiadvi...@google.com>
> wrote:
>
>
>
> > Hi TRH,
>
> > Could you let me know which version of AdWords API C# library you are
> > using?
>
> > Cheers,
> > Anash P. Oommen,
> > AdWords API Advisor.
>
> > On Aug 1, 12:13 am, none <part...@activistmanager.com> wrote:
>
> > > Using Visual Studio 2010, VB.Net, .Net 4.0, API 201003
>
> > > I’m having a very tough understanding why this has to be so hard.
>
> > > I’ve managed to convert the C# examples into VB.NET but the code can’t
> > > authenticate against the server. If I code the
> > > ApplicationConfiguration information into the vb.net module like this
>
> > > Dim ThisUser As New AdWordsUser
>
> > >         'These properties set the username / password and other
> > > information.
> > >         ApplicationConfiguration.logToFile = True
> > >         ApplicationConfiguration.logPath = "C:\somedirectory\"
> > >         ApplicationConfiguration.password = "PasswordOfMyMMCAccount"
> > >         ApplicationConfiguration.email = "E-MailOfMyMCCAccount"
> > >         ApplicationConfiguration.developerToken =
> > > "MyAlphaNumericDeveloperKey"
> > >         ApplicationConfiguration.clientCustomerId = "111-111-1111"
> > >         ApplicationConfiguration.adWordsApiUrl = "https://adwords-
> > > sandbox.google.com"
>
> > >         ThisUser.GetService(AdWordsService.v201003.CampaignService)
>
> > > I get a “Unable to connect to the remote server” and when I go into
> > > the error it tells me it’s trying to connect to the local host. It
> > > also fails to write any sort of error log into “C:\somedirectory”
>
> > > Conversely, when I comment out the line above and try to configure it
> > > in the App file in the root of my project like so.
> > >     <add key="CompanyName" value="ComanyName"/>
> > >     <add key="Email" value="
>
> ...
>
> read more »

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to