All notable changes to the code converter will be documented in this file. The format is based on Keep a Changelog
- Simplification now has a timeout to skip it after a time set in Tools->Options->Code Converter
- Fix Strings.ChrW conversion #924
- Fix mapping for error trivia added by converter. #917
- Fix CType expressions for conversions from String to Enums #918
- Only pull loop variables out when it's needed #915
- Fixed regression where loop with uninitiazed variable disappears from output #913
- Fix converting non-integral types to enums #888
- Fix types conversion for generic functions #893
- Fix casting Object to nullable types #904
- Fix converting Omitted/Optional parameters which could result in wrong method overload being called. #906
- Fix variable declaration being incorrectly pulled before the loop when it's initialized explicitly with default value. #911
- VS2019 (16.10) is now the minimum supported version
- Removed obsolete CodeWithOptions.FromLanguageVersion and CodeWithOptions.ToLanguageVersion #878
- Convert immediately executed lambdas without causing a compiler error #869
- Fix binary expressions for nullable types in VB->C# conversion #840
- Fix conversion of shared property containing static variable #881
- Use string.IsNullOrEmpty when comparing string to string.Empty #874
- Make an effort to maintain line-spacing between statements #879
- Fix wrong modifier for optional out parameter #882
- Correctly convert nested calls passing properties as ref arguments #876
- Improve conversion between nullable and not-nullable integrals/fractional/enum types #865
- Removed obsolete CodeWithOptions.FromLanguageVersion and CodeWithOptions.ToLanguageVersion #878
- Make an effort to maintain line-spacing between statements #879
- Last version supporting VS2017 and some earlier VS2019 versions (versions 15.7-16.9)
- Xml Namespace Imports now converted #836
- Use explicit cast when integral numeric types are casted to enum #861
- Correct inconsistent casing of event handlers #854
- Command line no longer silently exits for dot net framework projects
- Log messages now include timestamps
- Fix method arguments when calling a parametrized property with named arguments. #833
- Fix access modifiers for explicit interface implementations. #819
- Fix code generation for explicit interface implementations. #813
- Add support for converting multiple selected files and folders. #485
- Replace VB-specific library methods with idiomatic framework alternatives #814
- Remove redundant break expressions in switch-case statements. #432
- Generate out parameter instead of ref for implementations of external methods. #831
- When passing a property ByRef, don't try to assign it back afterwards #843
- Improve snippet detection #825
- Only trigger build for converted project where possible #816
- Convert Exit Try to a do while false loop with a break statement #779
- Fix missing parenthesis for null coalescing operator #811
- No longer throws NRE for VB Static variable without initializer. See comment on #623
- Convert nested xml literals to new XElement #253
- No longer throws NRE for embedded resources with no LastGenOutput #804
- Append CompareMethod.Text for Strings methods when needed #655
- Convert op_Implicit/op_Explicit calls to casts #678
- Use Conversions.ToString when concatenating a DateTime with a string #806
- Ensure named arguments are correctly named when followed by an omitted argument #808
- Convert static variables into fields #623
- Ensure query syntax join conditions are swapped to the necessary C# order #752
- Convert nested exit statements to if statements #690
- More terse conversion in for loop with literal end value #798
- Convert extension methods on ByRef reference types to static invocations #785
- Wire up events for WithEvents fields in an ancestor class #774
- Only create delegating property for WithEvents fields if there is a known write usage or descendant class Due to feedback on #615
- Attempt to improve VS2017 compatibility
- Convert with blocks using structs to a local ref variable#634
- Ensure xml-doc at start of file is kept #663
- Convert VB exclamation mark into C# indexer #765
- Deal with nullable bools in binary expressions #712
- No longer tries to qualify type parameters (e.g. in generic delegates) #771
- VS2017 compatibility improvement
- VS2022 Preview 3.1 compatibility
- Provided workaround in options for some assembly loading issues #741
- Convert
orderby distinct
in linq #736 - Convert nested Select queries in linq #635
Chr
converted toStrings.Chr
where code page aware conversion needed #745
- Guess some common using statements for incomplete fragments #743
- Support for VS2022
- Prevent overrides and overloads appearing on the same property #681
- Convert
Select x =
intolet x =
within Linq #717
- The --Core-Only flag no longer requires a value #704
- Deal with NullReferenceException caused by Nothing literal #707
- Include text of region which can't be converted
- Convert region names
- All handlers from multi-line handles syntax now converted #701
- Implicilty typed inherited events no longer create extra delegates #700
- Keep optional parameters for parameterized properties #642
- Maintain leading whitespace in comments #711
- Avoid XmlException when referencing certain nuget packages #714
- Use explicit type as default for array creation #713
- Hex values in UInt32 and Uint64 ranges not converted properly. #695
- Improve conversion accuracy for CInt #658
- Create non-static delegate when converting a shared event#671
- Improve implicit conversion of delegates #632
- Retain enum names in nullable Select Case #675
- Generics type parameter missed BC30737 and BC32042 [#682] (icsharpcode#682)
- XML output path needs output path prepending #641
- Converting explicit and implicit operator failed #659
- Web UI improvements #644
- Add "Paste as VB/C#" to "Paste special" menu #622
- (Fix regression) WithEvents field visibility converted correctly #616#618
- Type convert within compound assignments #612
- Type convert lambdas to a concrete delegate type if needed #611
- Type convert from decimal to double in more cases where needed #617
- Use casts rather than Conversions.To* for numeric conversions
- Timeout cosmetic operations (formatting/comments) after 15 minutes of inactivity #598
- Options page to adjust timeout
- Convert parameterized properties with optional parameters #597
- Convert bitwise negation #599
- No longer adds incorrect "base" qualification for virtual method calls #600
- Don't generate unnecessary properties for WithEvents fields #572
- Add type conversion where needed for externally declared loop control variable #609
- Convert string operators in common cases #608
- Type convert parameterized property in assignment #610
- Fix file extension and location of single converted file #589
- Correct logic for conversion "objectWithOverloadedEquals Is Nothing" #591
- Coercing enum to a string now correctly uses its numeric value #590
- Correct conversion for equality of overloaded types #594
- Correct conversion when for loop variable is a class member #601
- Correct conversion when for loop "To" expression is a boolean #602
- Workaround Visual Studio 16.7+ that was causing VB->CS conversion to fail #586
- Handle Option Compare Text case insensitive comparisons in switch statements #579
- Fix compilation error when switching with enum cases #549
- Improve numeric casts #580
- Add ref to conversion of RaiseEvent where needed #584
- Rename clashing type memvers #420
- Fix conversion for string implicitly converted to enum #476
- Rename explicit method implementations where needed #492
- Include type information in conversion of default(someType) #486
- Fixed UnauthorizedAccessException when converting single file/snippet
- When converting ReDim Preserve to Array.Resize, "ref" is now added
- Create delegating method for renamed implementations #443, #444
- Need to replace "Array.Resize(" with "Array.Resize(ref "
- Improve post-conversion experience for designer files - #569
- Optimize away some redundant casts and conversions with strings/chars - #388
- Improve performance of single file conversion - #546
- Add AsEnumerable where needed in linq "in" clause - #544
- Remove redundant empty string coalesce in string comparison - #500
- Convert VB comparison operators - #396
- Convert Redim Preserve of 1D array to Array.Resize - #501
- Use C#7.3 compatible null check
- Improve multi-declaration field conversion for arrays - #559
- Add parentheses around ternary statement - #565
- When converting ForEach loop, avoid duplicate variable compilation issue #558
- Improvements to for loop with missing semantic info - #482
- Fix logic issue when converting property passed byref - #324
- Fix logic issue when converting expression passed in byref within conditional expression - #310
- Added constructors now only added to the relevant type - not other types in the same file
- Converted non-static field initializers moved to constructor - #281
- Convert assignments using "Mid" built-in function
- Improve conversion of array initializer types
- Improve detection of compile-time constant case labels
- Fixes conversion in VS2017
- Convert files with legacy vb6 file extensions (e.g. .cls, .frm)
- Fix for converting For...Next...Step loops with a variable step that's sometimes negative #453
- Fix for abstract readonly/writeonly property conversion including a private accessor
- Generated parameterless constructors are now public by default
- Multiple classes in the same file no longer affect each other's constructors
- Cast expressions are now parenthesized when converted
- Fix nullref fatal error dialog for delegates with omitted argument types #560
- Fixes error thrown when converting single file from VB project with resx files
Known issue: Converting single file from VB project with resx files throws an error. To workaround, use a different version, or convert the whole project at once.
- All resx files now moved to project root #551
- Register event handlers for DesignerGenerated #550
- Improve qualification with arguments of unknown type #481
- Omit conversion in string concatenation where possible #508
- Use ToString for numeric types rather than Conversions.ToString
- Convert optional ref parameters - fixes #91
- Always convert Call statement to method call #445
- Avoid compilation errors when converting const Dates #213
- Evaluate simple compile time conversions within const declarations
- Avoid extra newlines in doc comments #334
- Avoid duplicate generated constructors #543
- Comparisons of value/generic types to Nothing now convert to the correct corresponding C# 8 operator
- Resources are now correctly namespaced after conversion #540
- LangVersion is now set to "Latest" in csproj e87fef11
- Improve Winforms designer event experience after conversion #547
- Don't output solution conversion for in-memory solution file
- Empty files are no longer skipped #423
- Specify type suffix for decimal and float literals containing decimal point #548
- Fixes conversion in VS2017
- Known issue: Breaks VS2017 support - please use 7.9.0 until the next version is released
- Improve performance and feedback for large projects containing large files
- IEnumerable<Task> becomes IAsyncEnumerable
- Upgraded target framework from netstandard 1.3 to netstandard 2.0
- Introduced cancellation token
- Convert "Handles" in some previously missed cases #530
- Wrap event handlers in lambda where needed #474
- Streamline trailing else if 810de96
- Use less error-prone, more performant null/default comparisons 4de1978
- Convert "{}" to "Array.Empty()" #495
- Convert inferred anonymous member names without duplicating name #480
- Convert "!" operator to element access #479
- Fix async method default return statements #478
- Convert multi-dimensional array initializers correctly #539
- Convert PrefixUnaryExpression (Not, minus, etc.) #533
- Rename more members with case conflicts (e.g. interface members) #533
- String equality conversion now calls "Equals" to match the C# logic #533
- Deduplicate imports #533
- Converts "default" keyword to "Nothing" keyword #428
- Exclude project file from conversion result if it hasn't changed
- Further efforts to stop the roslyn library crashing Visual Studio
- Conversion tasks are now cancellable
- More consistently add constructor for DesignerGenerated attribute
- Avoid incorrectly renaming symbols
- Prevent "SyntaxTree is not part of the compilation" error #527
- Avoid incorrectly renaming symbols #524
- Stop Roslyn from silently crashing Visual Studio during conversion #521
- Performance improvement on big solutions
- Partial class/method improvements
- Avoid ambiguity in some generated method calls
- Cast foreach collection to IEnumerable if needed or unknown
- Fix ordering bug converting redim bounds without preserve for 2d arrays
- Exit Property should become return #497
- First effort converting some Xml Member Access
- Avoid adding new keyword when not allowed/required #504
- Avoid evaluating Select Case expression multiple times in some cases where it may be non-deterministic or have side effects #323
- Avoid repeated redundant break statement caused by explicit Exit Select #433
- Convert return expression to match return type #496
- Fix conversion for hex values ending in "C" #483
- Converted multi line if blocks now always contain braces #466
- Add conversions to allow arithmetic on enums
- Add omitted argument lists on conditional expressions
- Winforms initialization improvements
- Convert VbMyResourcesResXFileCodeGenerator resource generator type in project file
- Improved comment conversion #518
- Rename local symbols differing only in case #80
- Remove erroneous event modifier from delegates
- Add Implements clause for event fields
- Add Overloads modifier where needed in VB
- Add ReadOnly/WriteOnly modifier for interface properties that need it
- Fix bug which led to nested modules
- Fix accessibility of converted public static classes
- Fix overqualifying with "Global" in some cases
- Fix parenthesized TryCast which caused compile error
- Fix erroneous rename of value argument in events' accessors and properties' setter
- Add call AscW method to convert Char to numeric types
- Remove erroneous backing fields' generation in root classes
- Add TryCast expression for convering to generic types
- Comments are now converted
- Some preprocessor directives are partially converted #517
- Fix Visual Studio crash when converting some structures
- Improve ambiguous name resolution
- Simplify compound assignment conversion
- Avoid some case conflicts
- Remove extra parentheses around CType expression
- Convert var declaration patterns with binary operators in switch statements (part of #222)
- Keep empty argument lists
- Several C# API tweaks wrapping conversion options into a type
- Fixed error caused when converting with "Copy to clipboard" option enabled
- Add modifier for nested types
- Remove body for converted extern methods
- Convert Call with missing argument list and semantic information
- Convert "is" expression (#427)
- Convert "*=" operator
- Fixes for nullrefs
- Load extension only when menu item clicked (multi-project conversion menu not present until project loaded)
- Convert implicit object->string cast correctly (#365)
- Convert trivia (e.g. comments) at start of file (#333)
- Improvements to redim conversion (#403, #393)
- Convert array of arrays initializer (#364)
- Improvements to implicit enum -> int conversion (#361)
- Convert expressions in constants (#329)
- Convert implicit
ElementAtOrDefault
(#362) - Convert types in ternary expressions (#363)
- Support for converting dot net standard VB projects (#398)
- Avoid compilation error for duplicate cases (#374)
- Correctly handle type promoted module symbols (#375)
- Prefer renamed imports for name resolution (#401)
- Correctly convert ambiguous names (#332)
- Ensure correct visibility for constructors (#422)
- Ensure casing is correct for namespaces (#421)
- Convert CType from a non numeric type to an enum
- Convert Exit Function
- Convert object initializers requiring type casts
- Convert async keyword on lambdas
- Convert nullable if statement conditions
- Convert property accessors with visiblity modifiers (#92)
- For loop with decrement (i--) results in missing 'Step -1' (#411)
- Improve escaping for variables of predefined types
- Add Implements keyword for explicitly implemented members
- Property/indexer conversion improvements
- Convert private default members
- Convert property accessors with visiblity modifiers (#92)
- For loop with decrement (i--) results in missing 'Step -1' (#411)
- Improve custom event conversion (#442)
- Parallelize multi-file conversion
- Make snippet conversion (ConvertText method) make classes partial by default since context isn't known (#379)
- Web converter requires .NET Core 3.0
- Visual Studio built-in simplification applied post-conversion (#386)
- Improve UI responsiveness and output window details while converting
- Implicitly typed local multi-variable declarations type converted correctly (#373)
- "My" namespace - first attempt at conversion (#169)
No longer restricts converted files to solution directory
- Improve UI feedback during conversion
- Improve conversion for inline functions
- Use visual basic "Conversions" functions to match VB logic
- Simplify output code by shortening some names
- Improve out parameter conversion
- Improve iterator conversion
- Improve with block conversion for value types
- Improve for loop conversion initialization/bounds
- No longer duplicates containing namespaces
- Improve some enum handling
- Avoid VB type appearing within
default(...)
expression
- Improve conversion of collection initializers
ProjectConversion
methods now require an IProgress parameter, deprecated overloads without it:
ProjectConversion.ConvertProject
ProjectConversion.ConvertProjectContents
ProjectConversion.ConvertProjectFile
Deprecated overload of ProjectConversion.ConvertSingle
in favour of one requiring a Document
Please instead use ConvertSingle(Document document, TextSpan selected, ILanguageConversion languageConversion)
See the implementation of the deprecated method for help in migrating.
- Compatible with Visual Studio ~15.5+
- Improve conversion for WithEvents/Handles
- Improve detection of enum related casts
- Convert parameterized properties
- Convert plain XML literals
- Convert more binary operators
- String comparison conversion now often avoids referencing VB library in output (when TextCompare is set to Binary)
- Convert WithEvents/Handles correctly for partial classes
- Convert Like operator
- Convert VB indexer to ElementAtOrDefault to make behaviour consistent
- Improve accuracy of choosing square brackets or parentheses
- Avoid nullref when converting for loop
- Enable OptionInfer on converted projects
- Convert global namespace correctly
- Assignment return now converted
- Enum implicit casts now converted
- Access to shared variables through instance now converted
- MyClass references now converted
- Variables explicitly initialised to their default (as is implicit in VB)
- Adds project reference to Microsoft.VisualBasic
- Uses Operators.CompareString for string equality comparison to match VB logic
- Uses DateAndTime for built-in date functions
- CDate() now converted to "Conversions.ToDate"
- Improvements to parenthesization
- Select Case with non-constant strings now converted correctly
- Interface readonly properties now converted correctly
- Downgrade Roslyn requirement in attempt to work with VS2017 15.3+
- Ensure "new()" generic constraint is last
- Do not convert MyBase.Finalize, it's implicit
- Standardize case of identifiers
- Ask people to upgrade VS if missing languageservices
- Improve event identifier conversion
- Improve conversion of interpolated strings (format, alignment, escaping)
- Avoid fatal error converting a project in a solution containing a website project (#243)
- Improve best-effort conversion in the presence of errors
- Improved nuget package and web converter's snippet detection
- Exclude conversion-source-language files from converted project
- Improve conversion of type casts
- Web UI tweaks
- Fix for interpolated strings and switch statements in VS2019 Preview
Fix initialization bug in VS2017
- Tuples now converted
- All known operator overloads now converted
- VS 2019 support
- Breaking API change: Most library API names and return types are now async
- Improve VS startup time by making package load async
- Added SourceLink
- Private setter added to conversion of ReadOnly properties to cater for backing field usage
- Usage of compiler generated event variable name converted correctly
- Access modifiers no longer added erroneously to static constructor
- "Do Until" construct multi-part conditions are correctly converted
- Tuple conversion support added
- VB -> C#: Error (lot of comments about the issue) when define an array with number of elements
- Decimal division conversion bugfix
- GoTo Case with dot in name converted correctly
- Fix array indexing from outside a class
- Escape double quotes with string interpolation
- Converts date literals
- Converts ChrW and Chr
- Converts type promoted module members
- Converts EntryPoint and Charset for native functions
- Converts WriteOnly interface properties
- Converts "Integer?" to int?
- Converts property setters with parameters not named "value"
- Fixed bug causing duplicate namespace qualification
- Parenthesizes ternary conditional when necessary to preserve logic
- Convert enums with explicit base type
- Parenthesize "as" cast if necessary
- Convert properties using "Item" syntax
- Extract variable for "To" expression
- Convert base constructor call missing parentheses
- Fix Nullref in SyntaxFactory.MethodDeclaration
- Performance improvement for large solutions
- Fix solution/project level context menu item not appearing when projects are within folders
- Fix solution level conversion issues for projects other than the first one
- Improve query syntax support (some forms of group now supported)
- Note: This release downgrades the library to net standard 1.3 for compatibility reasons - this should fix "could not load file or assembly netstandard, Culture=neutral'" error
- Type inferred const - convert to explicit type
- Improve name qualification
- Add parentheses around conditional expression in string interpolation
- Add parentheses where needed when convert Not, CType and TypeOf
- Fix namespace conversion issues
- Conversion error for indexer on property value of unresolved type
- Single-line lambda with statement body not implemented
- Array literals not always converted to implicit C# array
- Move options lower down in the context menus so they aren't in the way
- Handle WithEvents fields without initializers
- In lambda, use parentheses around single explicitly typed parameter
- Convert LocalDeclarationStatementSyntax
- Default parameter "value" now has the correct case
- Multiline xml doc comment conversion bugfix
- Interfaces "implements" clause now converted
- Shared no longer appears on Module members
- Fixed .Name bug with anonymous object creation
- Use Is and IsNot for reference type comparison
- Update to .NET Standard 2.0
- Convert solution and project files
- Added convert and copy to clipboard into options
- Convert WithEvents/Handles
- Convert
Handles
andWithEvents
similarly to the VB compiler - Handle expressions in Select Case
- Ensure all parts of a partial class have the partial modifier
- Handle missing optional arguments
- Increase number of default global imports for web conversion
- Default properties now converted
- Fix DeclarationExpressions without a type throwing exception
- Convert Throw Expressions to multi-line lambda function
- Convert properties with no accessors
- Fix error converting ObjectCollectionInitializerSyntax within object initializer
- Escape predefined if they are used for the name of declaration
- Improve support for sub-class snippets through the website
- Best effort conversion with errors as comments inline
- Tidy up duplicate import/using statements
- Using statements and array initialization improvements
- Convert select case expressions
- Fix for multi-parameter extension methods
- Convert single line void delegates
- Fix array initialization incorrect conversion bugs
- Convert operator overloads
- Overestimate when a method should be invoked with no parameters
- Remove global namespace in conversion
- Add Imports System.Runtime.InteropServices when convering an out parameter
- Support Erase and Redim Preserve
- Convert select case expressions
- Extend support for converting with blocks
- Convert C# 7.0 features: "is pattern", throw and declaration expressions
- Convert expression bodies
- Fix to ensure Case Else always comes last in a Select statement
- Convert base class constructor call
- Fix convert char from integer cast
- Convert hex literals to hex literals (rather than just integers)
- Fix to avoid using "_" as a parameter name
- Fix for loop variable missing declaration and initialization
- Convert declare to extern
- Fix to improve accuracy of adding AddressOf
- Convert block syntax
- Convert empty statement
- Fix to avoid single line if-else statement's conversion causing compilation error
- Fix to avoid delegate with no parameters throwing NullReferenceException
- Fix for change in logic when converting nested one-line if blocks
- Fix for loss of precision in arithmetic when using
/
operator - Integer division and bit shifting now converted
Is
andIsNot
operators now convertedNarrowing
andWidening
conversion operators now converted- Linq query syntax with no select clause now converted
DirectCast
operator now convertedShadows
modifier now converted (tonew
)
- Newline now appears before each attribute list
- Fix for
new
converting toShadows
- it now maps toOverloads
- VSIX: Gets conversion off the UI thread to avoid it freezing
- VB -> C#: VB projects referencing other VB projects no longer error
- VB -> C#: XmlDoc comments now are correctly newline terminated
- New commands added to convert whole solution/project at once
- Works reliably in VS2017
- Instead of copy to clipboard, opens result as Visual Studio window for quick viewing
- Writes summary to output window to explain what's happened
- Project context used for all conversions
- Query expression syntax converted in simple cases
- Anonymous object creation converted
- Object initializer syntax converted
- Converts comments in the majority of cases (though with some formatting oddities)
- Now works on sub-method snippets
- Names now fully qualified where necessary
- Out parameters correctly converted
- Move from Refactoring Essentials to a repository of its own
- Separate NuGet
- Separate VSIX
- Improvements on the VB side