All notable changes to the code converter will be documented in this file. The format is based on Keep a Changelog
- Convert parameterized properties with optional parameters #597
- 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
- 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