Skip to content

Value cannot be null. Parameter name: returnType at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.MethodDeclaration #168

@GrahamTheCoder

Description

@GrahamTheCoder

Input code

Unknown

Erroneous output

Multiple forms were unable to be loaded after the conversion. Trying to convert one of these gave the following error(s) Writing converted files to disk:

  • Failure processing PP Logistics\Forms\xfrmTUNPopup.vb System.ArgumentNullException: Value cannot be null. Parameter name: returnType
at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.MethodDeclaration(SyntaxList`1 attributeLists, SyntaxTokenList modifiers, TypeSyntax returnType, ExplicitInterfaceSpecifierSyntax explicitInterfaceSpecifier, SyntaxToken identifier, TypeParameterListSyntax typeParameterList, ParameterListSyntax parameterList, SyntaxList`1 constraintClauses, BlockSyntax body, ArrowExpressionClauseSyntax expressionBody, SyntaxToken semicolonToken) 
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.VisitDeclareStatement(DeclareStatementSyntax node) 
at Microsoft.CodeAnalysis.VisualBasic.Syntax.DeclareStatementSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor) 
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor`1.Visit(SyntaxNode node) 
at ICSharpCode.CodeConverter.CSharp.CommentConvertingNodesVisitor.DefaultVisit(SyntaxNode node) 
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor`1.VisitDeclareStatement(DeclareStatementSyntax node) 
at Microsoft.CodeAnalysis.VisualBasic.Syntax.DeclareStatementSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor) 
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.<>c__DisplayClass27_0.<<ConvertMembers>g__ConvertMembersInner\|0>d.MoveNext() 
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) 
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.ConvertMembers(SyntaxList`1 members) 
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.VisitClassBlock(ClassBlocBy 

Expected output

Unknown

Details

Product in use: VS extension

Version in use: ~5.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    VB -> C#Specific to VB -> C# conversion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions