nknhat / google-api-for-dotnet

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

[MethodAccessException: Google.API.Enumeration.get_Value()] #41

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Microsoft Web Express 2008
2. Add Reference

Here the code:
Dim instance As ICollection = 
Google.API.Translate.Language.TranslatableCollection
        Dim sLang As String = "None"
        For Each langb As Google.API.Translate.Language In instance
            sLang  = langb.Value + sLang 
        Next
        Me.TextBox1.Text = sLang 

3.

What is the expected output? What do you see instead?
Google.API.Enumeration.get_Value() 
Description: An unhandled exception occurred during the execution of the 
current web request. Please review the stack trace for more information 
about the error and where it originated in the code. 

Exception Details: System.MethodAccessException: 
Google.API.Enumeration.get_Value()

Source Error: 

Line 13:         Next
Line 14:         Me.TextBox1.Text = "Finished"
Line 15:     End Sub
Line 16: End Class

Source File: c:\Projects\eye5\eye5\Default.aspx.vb    Line: 15 

Stack Trace: 

[MethodAccessException: Google.API.Enumeration.get_Value()]
   eye5._Default.Button1_Click(Object sender, EventArgs e) in 
c:\Projects\eye5\eye5\Default.aspx.vb:15
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String 
eventArgument) +110

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaiseP
ostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler 
sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean 
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

---------------------------------------------------------------------------
-----
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; 
ASP.NET Version:2.0.50727.4016 

What version of the product are you using? 
4_Alpha

On what operating system?
Vista

Please provide any additional information below.

It worked the first time.

Original issue reported on code.google.com by amyhome2...@gmail.com on 10 Apr 2010 at 8:47

GoogleCodeExporter commented 8 years ago
Hello amyhome,
I've tested it in all four .NET edition with the code below. It's passed.
If it worked for you once, it should be OK, since no one changed the lib after 
that.
Check your project, make sure you refer the lib correctly.

        [Test]
        public void TranslatableCollectionTest()
        {
            var langugages = Language.TranslatableCollection;
            foreach (var language in langugages)
            {
                System.Console.WriteLine(language.Value);
            }
        }

Original comment by iron9li...@gmail.com on 12 Apr 2010 at 8:07

GoogleCodeExporter commented 8 years ago
It may be something wrong with assembly-merge (via ILMerge). 

Original comment by iron9li...@gmail.com on 19 Apr 2010 at 5:10

GoogleCodeExporter commented 8 years ago
Issue 43 has been merged into this issue.

Original comment by iron9li...@gmail.com on 19 Apr 2010 at 5:10

GoogleCodeExporter commented 8 years ago
how we solve it please anexception appear

Original comment by ibrahim....@gmail.com on 4 Oct 2013 at 9:10