You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to convert from VB to C# a whole winforms project none of the Designer.vb files are converted.
When I try to convert Form1.Designer.vb file I get a System.NullReferenceException.
Input code
Form1.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>_PartialClassForm1InheritsSystem.Windows.Forms.Form'Form overrides dispose to clean up the component list.<System.Diagnostics.DebuggerNonUserCode()>_ProtectedOverridesSubDispose(ByValdisposingAsBoolean)TryIfdisposingAndAlsocomponentsIsNotNothingThencomponents.Dispose()EndIfFinallyMyBase.Dispose(disposing)EndTryEndSub'Required by the Windows Form DesignerPrivatecomponentsAsSystem.ComponentModel.IContainer'NOTE: The following procedure is required by the Windows Form Designer'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor.<System.Diagnostics.DebuggerStepThrough()>_PrivateSubInitializeComponent()Me.Button1=NewSystem.Windows.Forms.Button()Me.SuspendLayout()''Button1'Me.Button1.Location=NewSystem.Drawing.Point(289,147)Me.Button1.Name="Button1"Me.Button1.Size=NewSystem.Drawing.Size(75,23)Me.Button1.TabIndex=0Me.Button1.Text="Button1"Me.Button1.UseVisualStyleBackColor=True''Form1'Me.AutoScaleDimensions=NewSystem.Drawing.SizeF(6.0!,13.0!)Me.AutoScaleMode=System.Windows.Forms.AutoScaleMode.FontMe.ClientSize=NewSystem.Drawing.Size(800,450)Me.Controls.Add(Me.Button1)Me.Name="Form1"Me.Text="Form1"Me.ResumeLayout(False)EndSubFriendWithEventsButton1AsButtonEndClass
Erroneous output
Writing converted files to disk:
* Failure processing Form1.Designer.vb
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxNodeRemover.SyntaxRemover.<>c.<.ctor>b__5_0(SyntaxNode n)
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxNodeRemover.SyntaxRemover..ctor(SyntaxNode[] nodesToRemove, SyntaxRemoveOptions options)
at Microsoft.CodeAnalysis.CSharp.Syntax.SyntaxNodeRemover.RemoveNodes[TRoot](TRoot root, IEnumerable`1 nodes, SyntaxRemoveOptions options)
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode.RemoveNodesCore(IEnumerable`1 nodes, SyntaxRemoveOptions options)
at Microsoft.CodeAnalysis.SyntaxNodeExtensions.RemoveNodes[TRoot](TRoot root, IEnumerable`1 nodes, SyntaxRemoveOptions options)
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.VisitFieldDeclaration(FieldDeclarationSyntax node)
at Microsoft.CodeAnalysis.VisualBasic.Syntax.FieldDeclarationSyntax.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.VisitFieldDeclaration(FieldDeclarationSyntax node)
at Microsoft.CodeAnalysis.VisualBasic.Syntax.FieldDeclarationSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor)
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.<>c__DisplayClass27_0.<<ConvertMembers>g__ConvertMembersInner|0>d.MoveNext()
at Microsoft.CodeAnalysis.SyntaxList`1.CreateNode(IEnumerable`1 nodes)
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.VisitClassBlock(ClassBlockSyntax node)
at Microsoft.CodeAnalysis.VisualBasic.Syntax.ClassBlockSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor)
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor`1.Visit(SyntaxNode node)
at ICSharpCode.CodeConverter.CSharp.CommentConvertingNodesVisitor.WithPortedTrivia[TSource,TDest](SyntaxNode node, Func`3 portExtraTrivia)
at ICSharpCode.CodeConverter.CSharp.CommentConvertingNodesVisitor.VisitClassBlock(ClassBlockSyntax node)
at Microsoft.CodeAnalysis.VisualBasic.Syntax.ClassBlockSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor)
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.<VisitCompilationUnit>b__24_3(StatementSyntax m)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Microsoft.CodeAnalysis.SyntaxList`1.CreateNode(IEnumerable`1 nodes)
at Microsoft.CodeAnalysis.SyntaxList`1..ctor(IEnumerable`1 nodes)
at Microsoft.CodeAnalysis.CSharp.SyntaxFactory.List[TNode](IEnumerable`1 nodes)
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.NodesVisitor.VisitCompilationUnit(CompilationUnitSyntax node)
at Microsoft.CodeAnalysis.VisualBasic.Syntax.CompilationUnitSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor)
at Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxVisitor`1.Visit(SyntaxNode node)
at ICSharpCode.CodeConverter.CSharp.CommentConvertingNodesVisitor.DefaultVisit(SyntaxNode node)
at ICSharpCode.CodeConverter.CSharp.CommentConvertingNodesVisitor.VisitCompilationUnit(CompilationUnitSyntax node)
at Microsoft.CodeAnalysis.VisualBasic.Syntax.CompilationUnitSyntax.Accept[TResult](VisualBasicSyntaxVisitor`1 visitor)
at ICSharpCode.CodeConverter.CSharp.VisualBasicConverter.ConvertCompilationTree(VisualBasicCompilation compilation, VisualBasicSyntaxTree tree)
at ICSharpCode.CodeConverter.CSharp.VBToCSConversion.SingleFirstPass(Compilation sourceCompilation, SyntaxTree tree)
at ICSharpCode.CodeConverter.Shared.ProjectConversion.SingleFirstPass(SyntaxTree tree, String treeFilePath)
at ICSharpCode.CodeConverter.Shared.ProjectConversion.FirstPass()
Code conversion failed with 1 error
Details
Product in use: VS 2017 Community version 15.7.4, VS extension 5.7.0.0
Last working version of VS extension: 5.6.3.0
The text was updated successfully, but these errors were encountered:
I believe #134 covered the same error message from this and is now fixed. #132 covers failure to convert files within a project, so let's move any further discussion to those issues. If you could check the latest build of master that'd be useful since I can't repro and #134 may be the root cause of #132.
Thanks for the issue report!
When I try to convert from VB to C# a whole winforms project none of the Designer.vb files are converted.
When I try to convert Form1.Designer.vb file I get a System.NullReferenceException.
Input code
Form1.Designer.vb
Erroneous output
Details
Product in use: VS 2017 Community version 15.7.4, VS extension 5.7.0.0
Last working version of VS extension: 5.6.3.0
The text was updated successfully, but these errors were encountered: