Results 1 to 6 of 6

Thread: VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Posts
    9

    Unhappy VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

    I am new to converting VB.Net code to C#.

    In Visual Studio I right click the VB.Net form a choose 'Convert to C#'.

    I then get 'cannot convert InvocationExpressionSyntax - see comment for details' errors.

    Please see attachment for error listing.

    I please need assistance with this.
    Attached Images Attached Images  

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

    The error message explicitly tells you to see the comment for details but it appears that you haven't done that, given that you haven't told us what the comment contains. The obvious next step is to follow that instruction.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Posts
    9

    Re: VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

    I do not know where the comment is.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

    The comment will probably be in the code, just before the line of code specified in the error list.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

    As si said, it will presumably be a comment created in the code where the error is. Did you even look at the code? You can double-click an error in that list to be taken directly to the line in question.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Posts
    9

    Re: VB.net Conversion to C# 'cannot convert InvocationExpressionSyntax...' error

    Sorry Sir, I had to deal with an issue.

    The comment I found is:



    #error Cannot convert InvocationExpressionSyntax - see comment for details

    /* Cannot convert ArgumentListSyntax, System.InvalidOperationException: Operation is not valid due to the current state of the object.

    at Microsoft.CodeAnalysis.VisualBasic.Symbols.ParameterSymbol.get_ExplicitDefaultValue()

    at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.CreateOptionalRefArg(IParameterSymbol p, RefKind refKind)

    at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.<GetAdditionalRequiredArgs>d__130.MoveNext()

    at System.Linq.Enumerable.<ConcatIterator>d__59`1.MoveNext()

    at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SeparatedList[TNode](IEnumerable`1 nodes)

    at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.<VisitArgumentList>d__54.MoveNext()

    --- End of stack trace from previous location where exception was thrown ---

    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

    at ICSharpCode.CodeConverter.CSharp.CommentConvertingVisitorWrapper.<ConvertHandledAsync>d__12`1.MoveNe xt()


    I will be very grateful for any help. It's Greek to me.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width