From d31e02cda495abacfa7a04ccabe332505af765e6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 16:01:33 +0000 Subject: [PATCH 01/41] git insists on commiting this formatting change --- Web/ClientApp/package.json | 128 ++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/Web/ClientApp/package.json b/Web/ClientApp/package.json index 4f14e9c9..e91845d5 100644 --- a/Web/ClientApp/package.json +++ b/Web/ClientApp/package.json @@ -1,64 +1,64 @@ -{ - "name": "codeconverter", - "version": "0.1.0", - "private": true, - "eslintConfig": { - "extends": "react-app" - }, - "scripts": { - "prestart": "node aspnetcore-https && node aspnetcore-react", - "start": "rimraf ./build && react-scripts start", - "build": "react-scripts build", - "test": "cross-env CI=true react-scripts test --env=jsdom", - "eject": "react-scripts eject", - "lint": "eslint ./src/" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "babel": { - "presets": [ - [ - "@babel/preset-react", - { - "runtime": "automatic" - } - ] - ] - }, - "dependencies": { - "@monaco-editor/react": "^4.6.0", - "axios": "^1.12.0", - "bootstrap": "^5.3.3", - "monaco-editor": "^0.52.0", - "prop-types": "^15.8.1", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-router-bootstrap": "^0.26.3", - "react-router-dom": "^6.26.2", - "reactstrap": "^9.2.3" - }, - "devDependencies": { - "@types/jest": "^29.5.13", - "@types/react": "^18.3.10", - "@types/react-dom": "^18.3.0", - "ajv": "^8.17.1", - "cross-env": "^7.0.3", - "eslint-config-react-app": "^7.0.1", - "http-proxy-middleware": "^3.0.2", - "jquery": "^3.7.1", - "popper.js": "^1.16.1", - "react-scripts": "^5.0.1", - "rimraf": "^6.0.1", - "typescript": "^4.9.5" - } -} +{ + "name": "codeconverter", + "version": "0.1.0", + "private": true, + "eslintConfig": { + "extends": "react-app" + }, + "scripts": { + "prestart": "node aspnetcore-https && node aspnetcore-react", + "start": "rimraf ./build && react-scripts start", + "build": "react-scripts build", + "test": "cross-env CI=true react-scripts test --env=jsdom", + "eject": "react-scripts eject", + "lint": "eslint ./src/" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "babel": { + "presets": [ + [ + "@babel/preset-react", + { + "runtime": "automatic" + } + ] + ] + }, + "dependencies": { + "@monaco-editor/react": "^4.6.0", + "axios": "^1.12.0", + "bootstrap": "^5.3.3", + "monaco-editor": "^0.52.0", + "prop-types": "^15.8.1", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-bootstrap": "^0.26.3", + "react-router-dom": "^6.26.2", + "reactstrap": "^9.2.3" + }, + "devDependencies": { + "@types/jest": "^29.5.13", + "@types/react": "^18.3.10", + "@types/react-dom": "^18.3.0", + "ajv": "^8.17.1", + "cross-env": "^7.0.3", + "eslint-config-react-app": "^7.0.1", + "http-proxy-middleware": "^3.0.2", + "jquery": "^3.7.1", + "popper.js": "^1.16.1", + "react-scripts": "^5.0.1", + "rimraf": "^6.0.1", + "typescript": "^4.9.5" + } +} From 26324ca6299cd8153ddcf6259297e1503703766e Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 16:01:57 +0000 Subject: [PATCH 02/41] Default vscode setup --- .vscode/launch.json | 35 +++++++++++++++++++++++++++++++++++ .vscode/settings.json | 5 +++++ .vscode/tasks.json | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..4df0114a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,35 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md. + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/Web/bin/Debug/ICSharpCode.CodeConverter.Web.dll", + "args": [], + "cwd": "${workspaceFolder}/Web", + "stopAtEntry": false, + // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..b5041f4d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "dotnet.preferCSharpExtension": true, + "dotnet.defaultSolution": "CodeConverter.sln", + "vscode-as-git-mergetool.settingsAssistantOnStartup": false +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..445a84fd --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/CodeConverter.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/CodeConverter.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/CodeConverter.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file From 3a207d21cc807b8fa146ba94d73c8a0697313de6 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 16:03:32 +0000 Subject: [PATCH 03/41] Use enumerable method, not array method --- CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs | 2 +- CodeConverter/CSharp/PerScopeState.cs | 2 +- CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs b/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs index cd67d465..ee700ceb 100644 --- a/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs +++ b/CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs @@ -542,7 +542,7 @@ public override async Task> VisitMultiLineIfBlock(VB elseClause = elseClause.WithVbSourceMappingFrom(node.ElseBlock); //Special case where explicit mapping is needed since block becomes clause so cannot be easily visited var elseIfBlocks = await node.ElseIfBlocks.SelectAsync(async elseIf => await ConvertElseIfAsync(elseIf)); - foreach (var elseIf in elseIfBlocks.Reverse()) { + foreach (var elseIf in Enumerable.Reverse(elseIfBlocks)) { var ifStmt = SyntaxFactory.IfStatement(elseIf.ElseIfCondition, elseIf.ElseBlock, elseClause); elseClause = SyntaxFactory.ElseClause(ifStmt); } diff --git a/CodeConverter/CSharp/PerScopeState.cs b/CodeConverter/CSharp/PerScopeState.cs index 1dfb06b9..57fa7ebd 100644 --- a/CodeConverter/CSharp/PerScopeState.cs +++ b/CodeConverter/CSharp/PerScopeState.cs @@ -225,7 +225,7 @@ public IEnumerable ConvertContinue(VBasic.SyntaxKind vbBlockKey { var scopesToExit = _hoistedNodesPerScope.Where(x => x.ExitableKind is not VBasic.SyntaxKind.None).TakeWhile(x => x.ExitableKind != vbBlockKeywordKind && x.IsBreakableInCs).ToArray(); // Select is breakable, but not continuable, so only need to break out of it on the way to something else, not if it's last. - scopesToExit = scopesToExit.Reverse().SkipWhile(x => x.ExitableKind is VBasic.SyntaxKind.SelectKeyword).Reverse().ToArray(); + scopesToExit = Enumerable.Reverse(scopesToExit).SkipWhile(x => x.ExitableKind is VBasic.SyntaxKind.SelectKeyword).Reverse().ToArray(); var assignmentExpression = CommonConversions.Literal(true); int i = 0; foreach (var scope in scopesToExit) { diff --git a/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs b/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs index e4d02e39..fc27a219 100644 --- a/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs +++ b/CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs @@ -133,7 +133,7 @@ private static ExpressionSyntax ReplacePlaceholderArgs(ExpressionSyntax zeroOrSi private static bool QualifiedMethodNameMatches(ISymbol symbol, params string[] parts) { if (symbol == null) return false; - foreach (var part in parts.Reverse()) { + foreach (var part in Enumerable.Reverse(parts)) { if (!part.Equals(symbol.Name, StringComparison.OrdinalIgnoreCase)) return false; symbol = symbol.ContainingSymbol; } From 33c66c818ca308bc7ff090eb3276cc3c36932478 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 16:03:39 +0000 Subject: [PATCH 04/41] Remove duplicated --- CodeConverter/CSharp/PerScopeState.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/CodeConverter/CSharp/PerScopeState.cs b/CodeConverter/CSharp/PerScopeState.cs index 57fa7ebd..a49fff97 100644 --- a/CodeConverter/CSharp/PerScopeState.cs +++ b/CodeConverter/CSharp/PerScopeState.cs @@ -253,7 +253,6 @@ private static AdditionalDeclaration HoistConditionalBreakOrContinue(ScopeState var ifTrue = new PostIfTrueBlock(scopeVar.IdentifierName, stmt); scope.HoistedNodes.Add(scopeVar); scope.HoistedNodes.Add(ifTrue); - return scopeVar; } return scopeVar; From 669966b04d5a3ff13aa109f2f4208358ea0a3bdc Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 16:37:57 +0000 Subject: [PATCH 05/41] Update ConsoleApp4.vbproj to target .NET 10.0 Changed the target framework in ConsoleApp4.vbproj from netcoreapp3.1 to net10.0 to upgrade the project to a newer .NET version. --- .../SourceFiles/ConsoleApp4/ConsoleApp4.vbproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj index 59c97ca8..ff4e8a93 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp4/ConsoleApp4.vbproj @@ -3,7 +3,7 @@ Exe ConsoleApp4 - netcoreapp3.1 + net10.0 From 462d5e4c1c51d5bdaf3707cec0f2853588b95d97 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 16:43:59 +0000 Subject: [PATCH 06/41] Project says netcore - stop it tageting netframework --- .../SourceFiles/NetCore/NetCore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj index c1c1e5f3..08ab42e4 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/NetCore/NetCore.csproj @@ -2,7 +2,7 @@ Exe - net472 + net10.0 From 132dccd0e32a6a3669a234fdae19e581e13ad8df Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 17:44:39 +0000 Subject: [PATCH 07/41] Don't force accessibility modifiers on interfaces --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index c04e2c7a..1585b901 100644 --- a/.editorconfig +++ b/.editorconfig @@ -130,7 +130,7 @@ dotnet_diagnostic.RCS1124.severity = none dotnet_diagnostic.RCS1077.severity = none # IDE0040: Add accessibility modifiers -dotnet_style_require_accessibility_modifiers = always:warning +dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning # IDE0048: Add parentheses for clarity dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:none From 765a3ea2c2bdcebb0d1039a91eb26b768f6793d5 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 17:45:43 +0000 Subject: [PATCH 08/41] Upgrade, and use type that becomes preferred in later versions --- CodeConverter/Common/DocumentExtensions.cs | 4 ++-- CommandLine/CodeConv/CodeConv.csproj | 2 +- Func/Func.csproj | 2 +- Tests/Tests.csproj | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CodeConverter/Common/DocumentExtensions.cs b/CodeConverter/Common/DocumentExtensions.cs index b0e0d9de..44251360 100644 --- a/CodeConverter/Common/DocumentExtensions.cs +++ b/CodeConverter/Common/DocumentExtensions.cs @@ -115,11 +115,11 @@ private static SyntaxNode WithWarningAnnotation(SyntaxNode node, string warningT { return node.WithAdditionalAnnotations(new SyntaxAnnotation(AnnotationConstants.ConversionErrorAnnotationKind, warningText)); } - private static OptionSet GetVBOptions(DocumentOptionSet options) + private static DocumentOptionSet GetVBOptions(DocumentOptionSet options) { return options; } - private static OptionSet GetCSOptions(DocumentOptionSet options) { + private static DocumentOptionSet GetCSOptions(DocumentOptionSet options) { return options; } } \ No newline at end of file diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index 0aee5326..ebf885ec 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 true true true diff --git a/Func/Func.csproj b/Func/Func.csproj index 11d48001..30942606 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -1,6 +1,6 @@  - net8.0 + net10.0 v4 Exe enable diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index aceb8e29..03445d49 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,6 +1,6 @@  - net472 + net10.0 Library ICSharpCode.CodeConverter.Tests ICSharpCode.CodeConverter.Tests @@ -33,9 +33,6 @@ - - - @@ -44,6 +41,9 @@ + + + From 7075a86b3f1a6626a4991d20b6c1173e37f6e2d8 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 17:46:48 +0000 Subject: [PATCH 09/41] Remove NetFramework project from sln (can tidy up fully later) --- CodeConverter.sln | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/CodeConverter.sln b/CodeConverter.sln index 3c9845cd..9cf8e128 100644 --- a/CodeConverter.sln +++ b/CodeConverter.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.31911.260 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 d18.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeConverter", "CodeConverter\CodeConverter.csproj", "{7EA075C6-6406-445C-AB77-6C47AFF88D58}" EndProject @@ -26,12 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommandLine", "CommandLine" CommandLine\README.md = CommandLine\README.md EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeConv.NetFramework", "CommandLine\CodeConv.NetFramework\CodeConv.NetFramework.csproj", "{CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeConv", "CommandLine\CodeConv\CodeConv.csproj", "{160F0B34-0F6F-4532-8D7B-39064956364D}" - ProjectSection(ProjectDependencies) = postProject - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D} = {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D} - EndProjectSection EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CodeConv.Shared", "CommandLine\CodeConv.Shared\CodeConv.Shared.shproj", "{D3A957FF-DAFC-4265-9AE2-D94F6473411A}" EndProject @@ -59,10 +54,6 @@ Global {08A20D4F-6310-43BB-B339-6317ACF3B52E}.Debug|Any CPU.Build.0 = Debug|Any CPU {08A20D4F-6310-43BB-B339-6317ACF3B52E}.Release|Any CPU.ActiveCfg = Release|Any CPU {08A20D4F-6310-43BB-B339-6317ACF3B52E}.Release|Any CPU.Build.0 = Release|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D}.Release|Any CPU.Build.0 = Release|Any CPU {160F0B34-0F6F-4532-8D7B-39064956364D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {160F0B34-0F6F-4532-8D7B-39064956364D}.Debug|Any CPU.Build.0 = Debug|Any CPU {160F0B34-0F6F-4532-8D7B-39064956364D}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -76,7 +67,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {CF18CBCF-67FF-46CA-8D1D-3221B7706D7D} = {926D43FE-D6AE-45E7-A933-8A0F866E7876} {160F0B34-0F6F-4532-8D7B-39064956364D} = {926D43FE-D6AE-45E7-A933-8A0F866E7876} {D3A957FF-DAFC-4265-9AE2-D94F6473411A} = {926D43FE-D6AE-45E7-A933-8A0F866E7876} EndGlobalSection @@ -85,7 +75,6 @@ Global EndGlobalSection GlobalSection(SharedMSBuildProjectFiles) = preSolution CommandLine\CodeConv.Shared\CodeConv.Shared.projitems*{160f0b34-0f6f-4532-8d7b-39064956364d}*SharedItemsImports = 5 - CommandLine\CodeConv.Shared\CodeConv.Shared.projitems*{cf18cbcf-67ff-46ca-8d1d-3221b7706d7d}*SharedItemsImports = 5 CommandLine\CodeConv.Shared\CodeConv.Shared.projitems*{d3a957ff-dafc-4265-9ae2-d94f6473411a}*SharedItemsImports = 13 EndGlobalSection EndGlobal From 68cf7dd2e3c1d15d559e91a702ec3a8d398df52f Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 17:47:38 +0000 Subject: [PATCH 10/41] Enable tests --- Tests/CSharp/MultiFileSolutionAndProjectTests.cs | 4 ++-- Tests/VB/MultiFileSolutionAndProjectTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/CSharp/MultiFileSolutionAndProjectTests.cs b/Tests/CSharp/MultiFileSolutionAndProjectTests.cs index dbf97a1f..26ba8433 100644 --- a/Tests/CSharp/MultiFileSolutionAndProjectTests.cs +++ b/Tests/CSharp/MultiFileSolutionAndProjectTests.cs @@ -18,14 +18,14 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur _multiFileTestFixture = multiFileTestFixture; } - [Fact(Skip = "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertWholeSolutionAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => true, Language.CS); } - [Fact(Skip= "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertVbLibraryOnlyAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == "VbLibrary", Language.CS); diff --git a/Tests/VB/MultiFileSolutionAndProjectTests.cs b/Tests/VB/MultiFileSolutionAndProjectTests.cs index 842ba3ab..e871bca9 100644 --- a/Tests/VB/MultiFileSolutionAndProjectTests.cs +++ b/Tests/VB/MultiFileSolutionAndProjectTests.cs @@ -18,14 +18,14 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur _multiFileTestFixture = multiFileTestFixture; } - [Fact(Skip = "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertWholeSolutionAsync() { //the `CSharpRefReturn` project is excluded because it has ref return properties which are not supported in VB await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name != "CSharpRefReturn", Language.VB); } - [Fact(Skip = "CI system cannot run this at the moment due to installed SDK versions")] + [Fact()] public async Task ConvertCSharpConsoleAppOnlyAsync() { await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name == "CSharpConsoleApp", Language.VB); From 0aca918e193ddf1b659d05949b04ebfe7b656e4c Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:02:52 +0000 Subject: [PATCH 11/41] Fix compile issues --- CodeConverter/CodeConverter.csproj | 4 +++- CommandLine/CodeConv/CodeConv.csproj | 5 +++-- Func/Func.csproj | 2 +- Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs | 4 ++-- Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs | 3 +-- Tests/TestConstants.cs | 4 ++-- Tests/TestRunners/TestFileRewriter.cs | 2 +- Tests/Tests.csproj | 5 ++--- Tests/VB/StandaloneStatementTests.cs | 1 - 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CodeConverter/CodeConverter.csproj b/CodeConverter/CodeConverter.csproj index d90ffbd0..2a460cfc 100644 --- a/CodeConverter/CodeConverter.csproj +++ b/CodeConverter/CodeConverter.csproj @@ -54,7 +54,9 @@ - + + compile + all diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index ebf885ec..c4eb2508 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -2,7 +2,7 @@ Exe - net10.0 + net8.0 true true true @@ -11,7 +11,7 @@ ICSharpCode.CodeConverter.CodeConv codeconv Bidirectional code converter for VB and C# - PackageReadme.md + PackageReadme.md https://github.com/icsharpcode/CodeConverter/ MIT CodeConvNuGetPackageIcon.png @@ -19,6 +19,7 @@ true enable $(ContinuousIntegrationBuild) + NU1510 diff --git a/Func/Func.csproj b/Func/Func.csproj index 30942606..11d48001 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -1,6 +1,6 @@  - net10.0 + net8.0 v4 Exe enable diff --git a/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs b/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs index 0e822305..cee31f3a 100644 --- a/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs +++ b/Tests/LanguageAgnostic/ParallelSelectAwaitTests.cs @@ -19,7 +19,7 @@ public async Task ExceptionDoesNotHaltPipelineAsync() return i > 3 ? i : throw new ObjectDisposedException("Original"); }, MaxDop); - Assert.Throws(() => asyncEnumerable.ToArrayAsync().GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await asyncEnumerable.ToArrayAsync()); } [Fact] @@ -30,7 +30,7 @@ public async Task ExceptionDoesNotHaltPipelineSyncAsync() , MaxDop ); - Assert.Throws(() => asyncEnumerable.ToArrayAsync().GetAwaiter().GetResult()); + await Assert.ThrowsAsync(async () => await asyncEnumerable.ToArrayAsync()); } [Fact] diff --git a/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs b/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs index 74d7da13..fcd85e53 100644 --- a/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs +++ b/Tests/LanguageAgnostic/ProjectFileTextEditorTests.cs @@ -1,5 +1,4 @@ -using System.Web.UI.WebControls; -using System.Xml.Linq; +using System.Xml.Linq; using System; using ICSharpCode.CodeConverter.Common; using Xunit; diff --git a/Tests/TestConstants.cs b/Tests/TestConstants.cs index 1c26a412..4fa077c9 100644 --- a/Tests/TestConstants.cs +++ b/Tests/TestConstants.cs @@ -19,8 +19,8 @@ public static class TestConstants public static string GetTestDataDirectory() { var assembly = Assembly.GetExecutingAssembly(); - var solutionDir = new FileInfo(new Uri(assembly.CodeBase).LocalPath).Directory?.Parent?.Parent ?? - throw new InvalidOperationException(assembly.CodeBase); + var solutionDir = new FileInfo(new Uri(assembly.Location).LocalPath).Directory?.Parent?.Parent ?? + throw new InvalidOperationException(assembly.Location); return Path.Combine(solutionDir.FullName, "TestData"); } } \ No newline at end of file diff --git a/Tests/TestRunners/TestFileRewriter.cs b/Tests/TestRunners/TestFileRewriter.cs index b49ddd64..f05e8075 100644 --- a/Tests/TestRunners/TestFileRewriter.cs +++ b/Tests/TestRunners/TestFileRewriter.cs @@ -19,7 +19,7 @@ private static Dictionary GetTestFileContents() private static string GetTestSourceDirectoryPath() { - string assemblyDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath); + string assemblyDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().Location).AbsolutePath); string testSourceDirectoryPath = Path.Combine(assemblyDir, @"..\..\"); return testSourceDirectoryPath; } diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 03445d49..16216645 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -11,7 +11,6 @@ - @@ -33,14 +32,14 @@ - + diff --git a/Tests/VB/StandaloneStatementTests.cs b/Tests/VB/StandaloneStatementTests.cs index 9baf185c..76064a77 100644 --- a/Tests/VB/StandaloneStatementTests.cs +++ b/Tests/VB/StandaloneStatementTests.cs @@ -1,5 +1,4 @@ using System.Threading.Tasks; -using System.Windows.Forms; using ICSharpCode.CodeConverter.Tests.TestRunners; using Xunit; From 864f150680937fe78df8be07a20fa3e93b7be107 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:22:38 +0000 Subject: [PATCH 12/41] Optional cancellation --- CodeConverter/CSharp/HandledEventsAnalyzer.cs | 4 ++-- CodeConverter/CSharp/UsageTypeAnalyzer.cs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CodeConverter/CSharp/HandledEventsAnalyzer.cs b/CodeConverter/CSharp/HandledEventsAnalyzer.cs index 6b3507c1..e187feee 100644 --- a/CodeConverter/CSharp/HandledEventsAnalyzer.cs +++ b/CodeConverter/CSharp/HandledEventsAnalyzer.cs @@ -62,10 +62,10 @@ private static int ParametersToDiscard(IEventSymbol e, IMethodSymbol handlingMet return toDiscard; } - private async Task IsNeverWrittenOrOverriddenAsync(ISymbol symbol) + private async Task IsNeverWrittenOrOverriddenAsync(ISymbol symbol, CancellationToken cancellationToken = default) { var projectSolution = _commonConversions.Document.Project.Solution; - if (!await projectSolution.IsNeverWrittenAsync(symbol, _initializeComponentLocationOrNull)) return false; + if (!await projectSolution.IsNeverWrittenAsync(symbol, _initializeComponentLocationOrNull, cancellationToken: cancellationToken)) return false; return !_typeToInheritors.Contains(symbol.ContainingType); } diff --git a/CodeConverter/CSharp/UsageTypeAnalyzer.cs b/CodeConverter/CSharp/UsageTypeAnalyzer.cs index afe99a61..342eea29 100644 --- a/CodeConverter/CSharp/UsageTypeAnalyzer.cs +++ b/CodeConverter/CSharp/UsageTypeAnalyzer.cs @@ -8,17 +8,17 @@ internal static class UsageTypeAnalyzer /// /// Only detects direct assignment, not use of ByRef, late binding, dynamic, reflection, etc. /// - public static async ValueTask IsNeverWrittenAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null) + public static async ValueTask IsNeverWrittenAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null, CancellationToken cancellationToken = default) { - return symbol.AllWriteUsagesKnowable() && !await ContainsWriteUsagesForAsync(solution, symbol, outsideLocation); + return symbol.AllWriteUsagesKnowable() && !await ContainsWriteUsagesForAsync(solution, symbol, outsideLocation, cancellationToken); } - public static async Task ContainsWriteUsagesForAsync(Solution solution, ISymbol symbol, Location outsideLocation = null) + public static async Task ContainsWriteUsagesForAsync(Solution solution, ISymbol symbol, Location outsideLocation = null, CancellationToken cancellationToken = default) { - var references = await GetUsagesAsync(solution, symbol, outsideLocation); + var references = await GetUsagesAsync(solution, symbol, outsideLocation, cancellationToken); var operationsReferencing = references.Select(async g => { - var semanticModel = await g.Doc.GetSemanticModelAsync(); - var syntaxRoot = await g.Doc.GetSyntaxRootAsync(); + var semanticModel = await g.Doc.GetSemanticModelAsync(cancellationToken); + var syntaxRoot = await g.Doc.GetSyntaxRootAsync(cancellationToken); return g.Usages.Select(l => syntaxRoot.FindNode(l.Location.SourceSpan)) .Select(syntaxNode => semanticModel.GetAncestorOperationOrNull(syntaxNode)); }); @@ -29,9 +29,9 @@ public static async Task ContainsWriteUsagesForAsync(Solution solution, IS return false; } - public static async Task> GetUsagesAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null) + public static async Task> GetUsagesAsync(this Solution solution, ISymbol symbol, Location outsideLocation = null, CancellationToken cancellationToken = default) { - var references = await SymbolFinder.FindReferencesAsync(symbol, solution); + var references = await SymbolFinder.FindReferencesAsync(symbol, solution, cancellationToken); return references.SelectMany(r => r.Locations).GroupBy(l => (Doc: l.Document, Tree: l.Location.SourceTree)) .Select(g => (g.Key.Doc, Usages: g.Where(l => l.Location.SourceTree != outsideLocation?.SourceTree || !l.Location.SourceSpan.OverlapsWith(outsideLocation.SourceSpan)).ToArray())) .Where(g => g.Usages.Any()); From 30a8eea8aa5178318e4850bd5c46434713969c75 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:22:55 +0000 Subject: [PATCH 13/41] Move to new library to allow dotnet10 compatibility (it has a breaking change here) --- CodeConverter/CSharp/HandledEventsAnalyzer.cs | 4 +++- CodeConverter/CodeConverter.csproj | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeConverter/CSharp/HandledEventsAnalyzer.cs b/CodeConverter/CSharp/HandledEventsAnalyzer.cs index e187feee..f15efb17 100644 --- a/CodeConverter/CSharp/HandledEventsAnalyzer.cs +++ b/CodeConverter/CSharp/HandledEventsAnalyzer.cs @@ -36,7 +36,9 @@ private async Task AnalyzeAsync() .ToDictionary(m => m.Key, g => g.First(), StringComparer.OrdinalIgnoreCase); // Uses the fact that GroupBy maintains addition order to get the closest declaration #pragma warning restore RS1024 // Compare symbols correctly - var writtenWithEventsProperties = await ancestorPropsMembersByName.Values.OfType().ToAsyncEnumerable().ToDictionaryAwaitAsync(async p => p.Name, async p => (p, await IsNeverWrittenOrOverriddenAsync(p)), StringComparer.OrdinalIgnoreCase); + + var writtenWithEventsProperties = await ancestorPropsMembersByName.Values.OfType().ToAsyncEnumerable() + .ToDictionaryAsync(async (p, _) => p.Name, async (p, cancellationToken) => (p, await IsNeverWrittenOrOverriddenAsync(p, cancellationToken))); var eventContainerToMethods = _type.GetMembers().OfType() .SelectMany(HandledEvents) diff --git a/CodeConverter/CodeConverter.csproj b/CodeConverter/CodeConverter.csproj index 2a460cfc..cbe21341 100644 --- a/CodeConverter/CodeConverter.csproj +++ b/CodeConverter/CodeConverter.csproj @@ -54,9 +54,7 @@ - - compile - + all From b280e11353e8b48cab79481a0f72e71be1461da2 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:30:09 +0000 Subject: [PATCH 14/41] Use new overload - the extra rename options can all be left as default since they will likely screw up for name clashes anyway --- CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs | 2 +- CodeConverter/Common/SymbolRenamer.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs b/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs index cf41e968..edd01922 100644 --- a/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs +++ b/CodeConverter/CSharp/ProjectMergedDeclarationExtensions.cs @@ -164,7 +164,7 @@ private static async Task RenamePrefixAsync(Project project, string old for (var symbolToRename = await GetElementToRename(project); symbolToRename != null; symbolToRename = await GetElementToRename(project, toSkip)) { string newName = symbolToRename.Name.Replace(oldNamePrefix, newNamePrefix); try { - var renamedSolution = await Renamer.RenameSymbolAsync(project.Solution, symbolToRename, newName, project.Solution.Workspace.Options, cancellationToken); + var renamedSolution = await Renamer.RenameSymbolAsync(project.Solution, symbolToRename, new SymbolRenameOptions(), newName, cancellationToken); project = renamedSolution.GetProject(project.Id); } catch (Exception e) { toSkip++; diff --git a/CodeConverter/Common/SymbolRenamer.cs b/CodeConverter/Common/SymbolRenamer.cs index 5ee78949..11559abb 100644 --- a/CodeConverter/Common/SymbolRenamer.cs +++ b/CodeConverter/Common/SymbolRenamer.cs @@ -31,11 +31,11 @@ public static async Task PerformRenamesAsync(Project project, IEnumerab var solution = project.Solution; foreach (var (originalSymbol, newName) in symbolsWithNewNames.OrderByDescending(s => s.Original.DeclaringSyntaxReferences.Select(x => x.Span.End).Max())) { project = solution.GetProject(project.Id); - var compilation = await project.GetCompilationAsync(); + var compilation = await project.GetCompilationAsync(cancellationToken); ISymbol currentDeclaration = SymbolFinder.FindSimilarSymbols(originalSymbol, compilation).FirstOrDefault(); if (currentDeclaration == null) continue; //Must have already renamed this symbol for a different reason - solution = await Renamer.RenameSymbolAsync(solution, currentDeclaration, newName, solution.Workspace.Options); + solution = await Renamer.RenameSymbolAsync(solution, currentDeclaration, new(), newName, cancellationToken); } return solution.GetProject(project.Id); From cc6157915a61daa056886453522bfb7226746c63 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:41:42 +0000 Subject: [PATCH 15/41] Fixups for API changes --- CodeConverter/CSharp/CommonConversions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeConverter/CSharp/CommonConversions.cs b/CodeConverter/CSharp/CommonConversions.cs index 60b10caa..3365628d 100644 --- a/CodeConverter/CSharp/CommonConversions.cs +++ b/CodeConverter/CSharp/CommonConversions.cs @@ -577,7 +577,7 @@ public static CSSyntax.VariableDeclaratorSyntax CreateVariableDeclarator(string { if (operation is IPropertyReferenceOperation pro && pro.Arguments.Any() && !VisualBasicExtensions.IsDefault(pro.Property)) { - var isSetter = pro.Parent.Kind == OperationKind.SimpleAssignment && pro.Parent.Children.First() == pro; + var isSetter = pro.Parent.Kind == OperationKind.SimpleAssignment && pro.Parent.ChildOperations.First() == pro; var extraArg = isSetter ? await GetParameterizedSetterArgAsync(operation) : null; @@ -684,7 +684,7 @@ public static ExpressionSyntax ThrowawayParameters(ExpressionSyntax invocable, i public static CSSyntax.ParameterListSyntax CreateParameterList(IEnumerable ps) { - return SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(ps)); + return SyntaxFactory.ParameterList(SyntaxFactory.SeparatedList(ps.Cast())); } public static ExpressionSyntax NotNothingComparison(ExpressionSyntax otherArgument, bool isReferenceType, bool inExpressionLambda = false) From 614d868606d82278667e94f4860dc8cd8633c137 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:42:12 +0000 Subject: [PATCH 16/41] Upgrade versions SPIKE: Ignore warnings to get compiling so I can test --- CodeConverter/CodeConverter.csproj | 11 +++++++---- CommandLine/CodeConv/CodeConv.csproj | 10 +++++----- Func/Func.csproj | 10 +++++----- Tests/Tests.csproj | 12 ++++++------ Vsix/Vsix.csproj | 2 +- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CodeConverter/CodeConverter.csproj b/CodeConverter/CodeConverter.csproj index cbe21341..05726a60 100644 --- a/CodeConverter/CodeConverter.csproj +++ b/CodeConverter/CodeConverter.csproj @@ -18,6 +18,9 @@ enable Recommended latest + + RS1039 + @@ -36,9 +39,9 @@ - - - + + + all @@ -55,7 +58,7 @@ - + all diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index c4eb2508..20a190f3 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 true true true @@ -19,7 +19,7 @@ true enable $(ContinuousIntegrationBuild) - NU1510 + NU1510;NU1903 @@ -34,9 +34,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers diff --git a/Func/Func.csproj b/Func/Func.csproj index 11d48001..3ae4b9a9 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -30,11 +30,11 @@ - - - - - + + + + + diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 16216645..860cbcad 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -9,15 +9,15 @@ true - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/Vsix/Vsix.csproj b/Vsix/Vsix.csproj index bad7ddc5..7f1bb0e5 100644 --- a/Vsix/Vsix.csproj +++ b/Vsix/Vsix.csproj @@ -51,7 +51,7 @@ - + compile; build; native; contentfiles; analyzers; buildtransitive From 3569e02cd790635dc33cf3b3268bf51a15d25cc7 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 18:50:57 +0000 Subject: [PATCH 17/41] Remove dependencies including build locator - theoretically this is auto-handled now --- CodeConverter/Common/DefaultReferences.cs | 2 +- .../CodeConv.NetFramework.csproj | 1 - .../CodeConv.Shared/MSBuildWorkspaceConverter.cs | 14 +------------- CommandLine/CodeConv/CodeConv.csproj | 9 --------- Func/Func.csproj | 2 +- Tests/Tests.csproj | 8 -------- 6 files changed, 3 insertions(+), 33 deletions(-) diff --git a/CodeConverter/Common/DefaultReferences.cs b/CodeConverter/Common/DefaultReferences.cs index 09dd9512..78357f4f 100644 --- a/CodeConverter/Common/DefaultReferences.cs +++ b/CodeConverter/Common/DefaultReferences.cs @@ -30,7 +30,7 @@ public static class DefaultReferences typeof(System.Xml.Linq.XElement), typeof(System.Linq.Expressions.Expression), typeof(Microsoft.VisualBasic.Constants), - typeof(System.Data.SqlClient.SqlCommand) + typeof(System.Data.Common.DbCommand) }.Select(t => t.Assembly).Concat( new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") } ).ToArray(); diff --git a/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj b/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj index 9a6f970b..057d5785 100644 --- a/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj +++ b/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj @@ -11,7 +11,6 @@ - diff --git a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs index d76cab89..a70d1808 100644 --- a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs +++ b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs @@ -14,7 +14,6 @@ using ICSharpCode.CodeConverter.Util; using ICSharpCode.CodeConverter.VB; using McMaster.Extensions.CommandLineUtils; -using Microsoft.Build.Locator; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.MSBuild; @@ -30,7 +29,6 @@ public sealed class MSBuildWorkspaceConverter : IDisposable private readonly AsyncLazy _workspace; //Cached to avoid NullRef from OptionsService when initialized concurrently (e.g. in our tests) private AsyncLazy? _cachedSolution; //Cached for performance of tests private readonly bool _isNetCore; - private Version? _versionUsed; public MSBuildWorkspaceConverter(string solutionFilePath, bool isNetCore, JoinableTaskFactory joinableTaskFactory, bool bestEffortConversion = false, Dictionary? buildProps = null) { @@ -95,8 +93,7 @@ private async Task GetSolutionAsync(string projectOrSolutionFile, IPro return solution; ValidationException CreateException(string mainMessage, string fullDetail) { - var versionUsedString = _versionUsed != null ? $"Used MSBuild {_versionUsed}.{Environment.NewLine}" : ""; - return new ValidationException($"{mainMessage}:{Environment.NewLine}{versionUsedString}{fullDetail}{Environment.NewLine}{mainMessage}"); + return new ValidationException($"{mainMessage}:{Environment.NewLine}{fullDetail}{Environment.NewLine}{mainMessage}"); } } @@ -120,15 +117,6 @@ private static async Task RestorePackagesForSolutionAsync(string solutionFile) private async Task CreateWorkspaceAsync(Dictionary buildProps) { - if (MSBuildLocator.CanRegister) { - var instances = MSBuildLocator.QueryVisualStudioInstances().ToArray(); - var instance = instances.OrderByDescending(x => x.Version).FirstOrDefault() - ?? throw new ValidationException("No Visual Studio instance available"); - MSBuildLocator.RegisterInstance(instance); - _versionUsed = instance.Version; - AppDomain.CurrentDomain.UseVersionAgnosticAssemblyResolution(); - } - var hostServices = await ThreadSafeWorkspaceHelper.CreateHostServicesAsync(MSBuildMefHostServices.DefaultAssemblies); return MSBuildWorkspace.Create(buildProps, hostServices); } diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index 20a190f3..7c8805d0 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -33,7 +33,6 @@ - @@ -41,14 +40,6 @@ all runtime; build; native; contentfiles; analyzers - - - - - - - - diff --git a/Func/Func.csproj b/Func/Func.csproj index 3ae4b9a9..b9b9d570 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -23,7 +23,7 @@ - + diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 860cbcad..5a679b1c 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -32,14 +32,6 @@ - From dbeef5f7aa2b2b35c8dfaf93cdaa287da0614ff8 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 19:42:16 +0000 Subject: [PATCH 18/41] Add new project, remove old --- .../CharacterizationTestSolution.sln | 16 +-- .../WinFormsAppVb/ApplicationEvents.vb | 29 +++++ .../WinFormsAppVb/Form1.Designer.vb | 31 +++++ .../SourceFiles/WinFormsAppVb/Form1.resx | 120 ++++++++++++++++++ .../SourceFiles/WinFormsAppVb/Form1.vb | 3 + .../My Project/Application.Designer.vb | 34 +++++ .../My Project/Application.myapp | 10 ++ .../WinFormsAppVb/WinFormsAppVb.vbproj | 32 +++++ .../WindowsAppVb/WindowsAppVb.vbproj | 7 + 9 files changed, 274 insertions(+), 8 deletions(-) create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln index 62d9b2f6..bcada55d 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 d18.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -26,16 +24,14 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix. EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -68,6 +64,10 @@ Global {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb new file mode 100644 index 00000000..3445e6db --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ApplicationEvents.vb @@ -0,0 +1,29 @@ +Imports Microsoft.VisualBasic.ApplicationServices + +Namespace My + ' The following events are available for MyApplication: + ' Startup: Raised when the application starts, before the startup form is created. + ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + ' UnhandledException: Raised if the application encounters an unhandled exception. + ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. + ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + ' Example: + ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + ' + ' ' Setting the application-wide default Font: + ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + ' + ' ' Setting the HighDpiMode for the Application: + ' e.HighDpiMode = HighDpiMode.PerMonitorV2 + ' + ' ' If a splash dialog is used, this sets the minimum display time: + ' e.MinimumSplashScreenDisplayTime = 4000 + ' End Sub + + Partial Friend Class MyApplication + + End Class +End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb new file mode 100644 index 00000000..0a21f031 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.Designer.vb @@ -0,0 +1,31 @@ + +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + + Protected Overrides Sub Dispose(disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.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. + + Private Sub InitializeComponent() + components = New System.ComponentModel.Container() + AutoScaleMode = AutoScaleMode.Font + ClientSize = New Size(800, 450) + Text = "Form1" + End Sub + +End Class diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb new file mode 100644 index 00000000..17d65956 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Form1.vb @@ -0,0 +1,3 @@ +Public Class Form1 + +End Class diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb new file mode 100644 index 00000000..86fcf0fa --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb @@ -0,0 +1,34 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = False + Me.EnableVisualStyles = True + Me.SaveMySettingsOnExit = True + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Form1 + End Sub + End Class +End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp new file mode 100644 index 00000000..0f12f323 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj new file mode 100644 index 00000000..082a8c14 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj @@ -0,0 +1,32 @@ + + + + WinExe + net10.0-windows + Sub Main + true + WindowsForms + + + + + + + + + + + True + True + Application.myapp + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj index e18703af..fcca337b 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj @@ -14,6 +14,7 @@ v4.8 true + true AnyCPU @@ -186,5 +187,11 @@ VbNetStandardLib + + + 4.6.1 + + + \ No newline at end of file From e588686fef03f5c665d26e8cc6289e7452c4dc52 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 20:04:19 +0000 Subject: [PATCH 19/41] Paste across files and tweak to try to get compiling as before --- .../App.config | 0 .../Folder/FolderForm.Designer.vb | 12 +++--- .../Folder/FolderForm.resx | 0 .../Folder/FolderForm.vb | 0 .../Folder/Resource2.Designer.vb | 2 +- .../Folder/Resource2.resx | 0 .../Folder/test2.png | Bin .../Folder2/Resource3.Designer.vb | 2 +- .../Folder2/Resource3.en-US.resx | 0 .../Folder2/Resource3.resx | 0 .../Folder2/test3.png | Bin .../My Project/Application.Designer.vb | 24 ++++++----- .../My Project/Application.myapp | 3 +- .../My Project/Resources.Designer.vb | 0 .../My Project/Resources.resx | 0 .../My Project/Settings.Designer.vb | 4 +- .../My Project/Settings.settings | 0 .../ReferencingFormThroughStatic.vb | 0 .../Resource1.Designer.vb | 2 +- .../Resource1.en-US.Designer.vb | 0 .../Resource1.en-US.resx | 0 .../Resource1.resx | 0 .../WinFormsAppVb/WinFormsAppVb.vbproj | 4 ++ .../WindowsAppVb.vbproj | 0 .../WinformsDesignerTest.Designer.vb | 0 .../WinformsDesignerTest.resx | 0 .../WinformsDesignerTest.vb | 0 .../{WindowsAppVb => WinFormsAppVb}/test.png | Bin .../My Project/Application.Designer.vb | 38 ------------------ .../WindowsAppVb/My Project/Application.myapp | 11 ----- .../WindowsAppVb/My Project/AssemblyInfo.vb | 35 ---------------- 31 files changed, 31 insertions(+), 106 deletions(-) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/App.config (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder/FolderForm.Designer.vb (95%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder/FolderForm.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder/FolderForm.vb (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder/Resource2.Designer.vb (97%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder/Resource2.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder/test2.png (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder2/Resource3.Designer.vb (97%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder2/Resource3.en-US.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder2/Resource3.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Folder2/test3.png (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/My Project/Resources.Designer.vb (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/My Project/Resources.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/My Project/Settings.Designer.vb (94%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/My Project/Settings.settings (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/ReferencingFormThroughStatic.vb (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Resource1.Designer.vb (97%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Resource1.en-US.Designer.vb (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Resource1.en-US.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/Resource1.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/WindowsAppVb.vbproj (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/WinformsDesignerTest.Designer.vb (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/WinformsDesignerTest.resx (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/WinformsDesignerTest.vb (100%) rename Tests/TestData/MultiFileCharacterization/SourceFiles/{WindowsAppVb => WinFormsAppVb}/test.png (100%) delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.myapp delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/App.config b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/App.config similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/App.config rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/App.config diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.Designer.vb similarity index 95% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.Designer.vb index 8f3921d9..c562987b 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.Designer.vb @@ -54,7 +54,7 @@ Partial Class FolderForm 'ToolStripButton1 ' Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton1.Image = Global.WindowsAppVb.My.Resources.Resources.test + Me.ToolStripButton1.Image = Global.WinFormsAppVb.My.Resources.Resources.test Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton1.Name = "ToolStripButton1" Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22) @@ -63,7 +63,7 @@ Partial Class FolderForm 'ToolStripButton2 ' Me.ToolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton2.Image = Global.WindowsAppVb.My.Resources.Resources.test2 + Me.ToolStripButton2.Image = Global.WinFormsAppVb.My.Resources.Resources.test2 Me.ToolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton2.Name = "ToolStripButton2" Me.ToolStripButton2.Size = New System.Drawing.Size(23, 22) @@ -72,7 +72,7 @@ Partial Class FolderForm 'ToolStripButton3 ' Me.ToolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton3.Image = Global.WindowsAppVb.My.Resources.Resources.test3 + Me.ToolStripButton3.Image = Global.WinFormsAppVb.My.Resources.Resources.test3 Me.ToolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton3.Name = "ToolStripButton3" Me.ToolStripButton3.Size = New System.Drawing.Size(23, 22) @@ -81,7 +81,7 @@ Partial Class FolderForm 'ToolStripButton4 ' Me.ToolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton4.Image = Global.WindowsAppVb.My.Resources.Resource1.test + Me.ToolStripButton4.Image = Global.WinFormsAppVb.My.Resources.Resource1.test Me.ToolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton4.Name = "ToolStripButton4" Me.ToolStripButton4.Size = New System.Drawing.Size(23, 22) @@ -90,7 +90,7 @@ Partial Class FolderForm 'ToolStripButton5 ' Me.ToolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton5.Image = Global.WindowsAppVb.My.Resources.Resource1.test2 + Me.ToolStripButton5.Image = Global.WinFormsAppVb.My.Resources.Resource1.test2 Me.ToolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton5.Name = "ToolStripButton5" Me.ToolStripButton5.Size = New System.Drawing.Size(23, 22) @@ -99,7 +99,7 @@ Partial Class FolderForm 'ToolStripButton6 ' Me.ToolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.ToolStripButton6.Image = Global.WindowsAppVb.My.Resources.Resource1.test3 + Me.ToolStripButton6.Image = Global.WinFormsAppVb.My.Resources.Resource1.test3 Me.ToolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta Me.ToolStripButton6.Name = "ToolStripButton6" Me.ToolStripButton6.Size = New System.Drawing.Size(23, 22) diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/FolderForm.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/FolderForm.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.Designer.vb similarity index 97% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.Designer.vb index b7c3af9f..c9f17546 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsAppVb.Resource2", GetType(Resource2).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinFormsAppVb.Resource2", GetType(Resource2).Assembly) resourceMan = temp End If Return resourceMan diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/Resource2.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/Resource2.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/test2.png b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/test2.png similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder/test2.png rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder/test2.png diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.Designer.vb similarity index 97% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.Designer.vb index d20900e6..04eabcc9 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Friend Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsAppVb.Resource3", GetType(Resource3).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinFormsAppVb.Resource3", GetType(Resource3).Assembly) resourceMan = temp End If Return resourceMan diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.en-US.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.en-US.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.en-US.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.en-US.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/Resource3.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/Resource3.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/test3.png b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/test3.png similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Folder2/test3.png rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Folder2/test3.png diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb index 86fcf0fa..0bdda9b6 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.Designer.vb @@ -8,27 +8,31 @@ ' '------------------------------------------------------------------------------ -Namespace My +Option Strict On +Option Explicit On + - 'NOTE: This file is auto-generated; do not modify it directly. To make changes, +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication - - + + _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - Me.IsSingleInstance = False - Me.EnableVisualStyles = True - Me.SaveMySettingsOnExit = True + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub - - + + _ Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Form1 + Me.MainForm = Global.WinFormsAppVb.WinformsDesignerTest End Sub End Class End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp index 0f12f323..1243847f 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Application.myapp @@ -6,5 +6,6 @@ 0 true 0 + 0 true - \ No newline at end of file + diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.Designer.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.Designer.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Resources.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Resources.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.Designer.vb similarity index 94% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.Designer.vb index e993f30b..23537768 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.Designer.vb @@ -64,9 +64,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.WindowsAppVb.My.MySettings + Friend ReadOnly Property Settings() As Global.WinFormsAppVb.My.MySettings Get - Return Global.WindowsAppVb.My.MySettings.Default + Return Global.WinFormsAppVb.My.MySettings.Default End Get End Property End Module diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.settings b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.settings similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Settings.settings rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/My Project/Settings.settings diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/ReferencingFormThroughStatic.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ReferencingFormThroughStatic.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/ReferencingFormThroughStatic.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/ReferencingFormThroughStatic.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.Designer.vb similarity index 97% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.Designer.vb index 2e614b97..1a1016fe 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.Designer.vb @@ -43,7 +43,7 @@ Namespace My.Resources Public Shared ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager Get If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsAppVb.Resource1", GetType(Resource1).Assembly) + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WinFormsAppVb.Resource1", GetType(Resource1).Assembly) resourceMan = temp End If Return resourceMan diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.Designer.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.Designer.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.en-US.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.en-US.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/Resource1.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/Resource1.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj index 082a8c14..5f48b39f 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinFormsAppVb.vbproj @@ -14,6 +14,10 @@ + + + + True diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WindowsAppVb.vbproj similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WindowsAppVb.vbproj rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WindowsAppVb.vbproj diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.Designer.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.Designer.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.Designer.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.resx similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.resx rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.resx diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/WinformsDesignerTest.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/WinformsDesignerTest.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/test.png b/Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/test.png similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/test.png rename to Tests/TestData/MultiFileCharacterization/SourceFiles/WinFormsAppVb/test.png diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb deleted file mode 100644 index 874c09e9..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.Designer.vb +++ /dev/null @@ -1,38 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - 'NOTE: This file is auto-generated; do not modify it directly. To make changes, - ' or if you encounter build errors in this file, go to the Project Designer - ' (go to Project Properties or double-click the My Project node in - ' Solution Explorer), and make changes on the Application tab. - ' - Partial Friend Class MyApplication - - _ - Public Sub New() - MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - Me.IsSingleInstance = false - Me.EnableVisualStyles = true - Me.SaveMySettingsOnExit = true - Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses - End Sub - - _ - Protected Overrides Sub OnCreateMainForm() - Me.MainForm = Global.WindowsAppVb.WinformsDesignerTest - End Sub - End Class -End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.myapp deleted file mode 100644 index 1243847f..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/Application.myapp +++ /dev/null @@ -1,11 +0,0 @@ - - - true - Form1 - false - 0 - true - 0 - 0 - true - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb deleted file mode 100644 index ae9fa230..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/WindowsAppVb/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - From ce78a882fc7d0149a006bbdd2c0032cf0efa04d0 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 20:45:07 +0000 Subject: [PATCH 20/41] Totally redo this converter by getting AI to merge in bits of a separately runnable file I made to test the approach --- .../CodeConv.Shared/CodeConv.Shared.projitems | 2 +- .../CodeConv.Shared/CodeConvProgram.cs | 2 +- .../MSBuildWorkspaceConverter.cs | 298 ++++++++++++------ Tests/TestRunners/MultiFileTestFixture.cs | 2 +- 4 files changed, 207 insertions(+), 97 deletions(-) diff --git a/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems b/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems index 23003736..1a2e17d3 100644 --- a/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems +++ b/CommandLine/CodeConv.Shared/CodeConv.Shared.projitems @@ -11,7 +11,7 @@ - + diff --git a/CommandLine/CodeConv.Shared/CodeConvProgram.cs b/CommandLine/CodeConv.Shared/CodeConvProgram.cs index 60a0991d..1463b713 100644 --- a/CommandLine/CodeConv.Shared/CodeConvProgram.cs +++ b/CommandLine/CodeConv.Shared/CodeConvProgram.cs @@ -150,7 +150,7 @@ private async Task ConvertAsync(IProgress progress, Cancella var properties = ParsedProperties(); var joinableTaskFactory = new JoinableTaskFactory(new JoinableTaskContext()); - var msbuildWorkspaceConverter = new MSBuildWorkspaceConverter(finalSolutionPath, CoreOnlyProjects, joinableTaskFactory, BestEffort, properties); + var msbuildWorkspaceConverter = new MsBuildWorkspaceConverter(finalSolutionPath, CoreOnlyProjects, joinableTaskFactory, BestEffort, properties); var converterResultsEnumerable = msbuildWorkspaceConverter.ConvertProjectsWhereAsync(ShouldIncludeProject, TargetLanguage, progress, cancellationToken); await ConversionResultWriter.WriteConvertedAsync(converterResultsEnumerable, finalSolutionPath, outputDirectory, Force, true, strProgress, cancellationToken); diff --git a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs index a70d1808..bf76ceff 100644 --- a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs +++ b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs @@ -1,128 +1,238 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.Collections.Immutable; +using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; +using System.Text; using System.Threading; using System.Threading.Tasks; -using CodeConv.Shared.Util; -using ICSharpCode.CodeConverter.CommandLine.Util; -using ICSharpCode.CodeConverter.CSharp; -using ICSharpCode.CodeConverter.DotNetTool.Util; -using ICSharpCode.CodeConverter.Common; -using ICSharpCode.CodeConverter.Util; -using ICSharpCode.CodeConverter.VB; -using McMaster.Extensions.CommandLineUtils; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.MSBuild; -using Microsoft.VisualStudio.Threading; +using Microsoft.CodeAnalysis.Diagnostics; +using ICSharpCode.CodeConverter; +using ICSharpCode.CodeConverter.Common; namespace ICSharpCode.CodeConverter.CommandLine; -public sealed class MSBuildWorkspaceConverter : IDisposable +/// +/// Provides high-fidelity analysis of .NET solutions by mimicking the behavior of 'dotnet build'. +/// +public sealed class MsBuildWorkspaceConverter { - private readonly bool _bestEffortConversion; private readonly string _solutionFilePath; - private readonly Dictionary _buildProps; - private readonly AsyncLazy _workspace; //Cached to avoid NullRef from OptionsService when initialized concurrently (e.g. in our tests) - private AsyncLazy? _cachedSolution; //Cached for performance of tests - private readonly bool _isNetCore; - - public MSBuildWorkspaceConverter(string solutionFilePath, bool isNetCore, JoinableTaskFactory joinableTaskFactory, bool bestEffortConversion = false, Dictionary? buildProps = null) + // The other parameters are ignored for compatibility + public MsBuildWorkspaceConverter(string solutionFilePath, bool isNetCore, object joinableTaskFactory, bool bestEffortConversion = false, Dictionary? buildProps = null) { - _bestEffortConversion = bestEffortConversion; - _buildProps = buildProps ?? new Dictionary(); - _buildProps.TryAdd("Configuration", "Debug"); - _buildProps.TryAdd("Platform", "AnyCPU"); _solutionFilePath = solutionFilePath; - _isNetCore = isNetCore; - _workspace = new AsyncLazy(() => CreateWorkspaceAsync(_buildProps), joinableTaskFactory); } - public async IAsyncEnumerable ConvertProjectsWhereAsync(Func shouldConvertProject, Language? targetLanguage, IProgress progress, [EnumeratorCancellation] CancellationToken token) + /// + /// Maintains compatibility: yields a ConversionResult for each diagnostic in the solution. + /// + public async IAsyncEnumerable ConvertProjectsWhereAsync( + Func shouldConvertProject, + Language? targetLanguage, + IProgress progress, + [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken token) { - var strProgress = new Progress(s => progress.Report(new ConversionProgress(s))); -#pragma warning disable VSTHRD012 // Provide JoinableTaskFactory where allowed - Shouldn't need main thread, and I can't access ThreadHelper without referencing VS shell. - _cachedSolution ??= new AsyncLazy(async () => await GetSolutionAsync(_solutionFilePath, strProgress)); -#pragma warning restore VSTHRD012 // Provide JoinableTaskFactory where allowed - var solution = await _cachedSolution.GetValueAsync(); - - if (!targetLanguage.HasValue) { - targetLanguage = solution.Projects.Any(p => p.Language == LanguageNames.VisualBasic) ? Language.CS : Language.VB; + var analysis = await AnalyzeSolutionAsync(_solutionFilePath); + foreach (var projectResult in analysis.ProjectResults) + { + if (!shouldConvertProject(projectResult.Project)) continue; + foreach (var diag in projectResult.Diagnostics) + { + var result = new ConversionResult(new Exception(diag.ToString())) + { + SourcePathOrNull = projectResult.Project.FilePath + }; + yield return result; + } } - - var languageConversion = targetLanguage == Language.CS - ? (ILanguageConversion)new VBToCSConversion() - : new CSToVBConversion(); - languageConversion.ConversionOptions = new ConversionOptions {AbandonOptionalTasksAfter = TimeSpan.FromHours(4)}; - var languageNameToConvert = targetLanguage == Language.CS - ? LanguageNames.VisualBasic - : LanguageNames.CSharp; - - var projectsToConvert = solution.Projects.Where(p => p.Language == languageNameToConvert && shouldConvertProject(p)).ToArray(); - var results = SolutionConverter.CreateFor(languageConversion, projectsToConvert, progress, token).ConvertAsync(); - await foreach (var r in results.WithCancellation(token)) yield return r; } - private async Task GetSolutionAsync(string projectOrSolutionFile, IProgress progress) + /// + /// Analyzes a complete .NET solution (.sln) file and returns diagnostics for all projects. + /// + /// The absolute path to the .sln file. + /// The build configuration (e.g., "Debug" or "Release"). + /// A SolutionAnalysisResult containing all projects and diagnostics. + public async Task AnalyzeSolutionAsync(string solutionPath, string configuration = "Debug") { - progress.Report($"Running dotnet restore on {projectOrSolutionFile}"); - await RestorePackagesForSolutionAsync(projectOrSolutionFile); - - var workspace = await _workspace.GetValueAsync(); - var solution = string.Equals(Path.GetExtension(projectOrSolutionFile), ".sln", StringComparison.OrdinalIgnoreCase) ? await workspace.OpenSolutionAsync(projectOrSolutionFile) - : (await workspace.OpenProjectAsync(projectOrSolutionFile)).Solution; - - var errorString = await GetCompilationErrorsAsync(solution.Projects); - if (string.IsNullOrEmpty(errorString)) return solution; - errorString = " " + errorString.Replace(Environment.NewLine, Environment.NewLine + " "); - progress.Report($"Compilation errors found before conversion.:{Environment.NewLine}{errorString}"); - - bool wrongFramework = new[] { "Type 'System.Void' is not defined", "is missing from assembly" }.Any(errorString.Contains); - if (_bestEffortConversion) { - progress.Report("Attempting best effort conversion on broken input due to override"); - } else if (wrongFramework && _isNetCore) { - throw CreateException($"Compiling with dotnet core caused compilation errors, install VS2019+ or use the option `{CodeConvProgram.CoreOptionDefinition} false` to force attempted conversion with older versions (not recommended)", errorString); - } else if (wrongFramework && !_isNetCore) { - throw CreateException($"Compiling with .NET Framework MSBuild caused compilation errors, use the {CodeConvProgram.CoreOptionDefinition} true option if this is a .NET core only solution", errorString); - } else { - throw CreateException("Fix compilation errors before conversion for an accurate conversion, or as a last resort, use the best effort conversion option", errorString); - } - return solution; - - ValidationException CreateException(string mainMessage, string fullDetail) { - return new ValidationException($"{mainMessage}:{Environment.NewLine}{fullDetail}{Environment.NewLine}{mainMessage}"); - } + var analyzer = new SolutionAnalyzer(); + return await analyzer.AnalyzeSolutionAsync(solutionPath, configuration); } - private async Task GetCompilationErrorsAsync( - IEnumerable projectsToConvert) + /// + /// A container for the results of a full solution analysis. + /// + public class SolutionAnalysisResult { - var workspaceErrors = (await _workspace.GetValueAsync()).Diagnostics.GetErrorString(); - var errors = await projectsToConvert.ParallelSelectAwaitAsync(async x => { - var c = await x.GetCompilationAsync() ?? throw new InvalidOperationException($"Compilation could not be created for {x.Language}"); - return new[] { CompilationWarnings.WarningsForCompilation(c, c.AssemblyName) }; - }, Env.MaxDop).ToArrayAsync(); - var errorString = string.Join("\r\n", workspaceErrors.Yield().Concat(errors.SelectMany(w => w)).Where(w => w != null)); - return errorString; + public Solution Solution { get; set; } = null!; + public List ProjectResults { get; set; } = new List(); + public IEnumerable AllDiagnostics => ProjectResults.SelectMany(p => p.Diagnostics); } - private static async Task RestorePackagesForSolutionAsync(string solutionFile) + /// + /// A container for the results of a single project analysis. + /// + public class ProjectAnalysisResult { - var restoreExitCode = await ProcessRunner.ConnectConsoleGetExitCodeAsync(DotNetExe.FullPathOrDefault(), "restore", solutionFile); - if (restoreExitCode != 0) throw new ValidationException("dotnet restore had a non-zero exit code."); + public Project Project { get; set; } = null!; + public IReadOnlyList Diagnostics { get; set; } = Array.Empty(); } - private async Task CreateWorkspaceAsync(Dictionary buildProps) + private class SolutionAnalyzer { - var hostServices = await ThreadSafeWorkspaceHelper.CreateHostServicesAsync(MSBuildMefHostServices.DefaultAssemblies); - return MSBuildWorkspace.Create(buildProps, hostServices); - } + private readonly List _loadDiagnostics = new(); + + public async Task AnalyzeSolutionAsync(string solutionPath, string configuration = "Debug") + { + // === PREREQUISITE: Run 'dotnet restore' === + await RunDotnetRestoreAsync(solutionPath); + + _loadDiagnostics.Clear(); + + // === STEP 1: Create and Configure Workspace === + var properties = new Dictionary + { + { "Configuration", configuration }, + { "RunAnalyzers", "true" }, + { "RunAnalyzersDuringBuild", "true" } + }; + + using var workspace = MSBuildWorkspace.Create(properties); + workspace.WorkspaceFailed += HandleWorkspaceFailure; + + Solution solution; + try + { + solution = await workspace.OpenSolutionAsync(solutionPath); + } + finally + { + workspace.WorkspaceFailed -= HandleWorkspaceFailure; + } + + // === STEP 2: Analyze Each Project === + var projectResults = new List(); + foreach (var project in solution.Projects) + { + var projectResult = await AnalyzeProjectAsync(project); + projectResults.Add(projectResult); + } + + // Include load diagnostics in the first project or create a dummy entry + if (projectResults.Count > 0 && _loadDiagnostics.Any()) + { + var firstProject = projectResults[0]; + projectResults[0] = new ProjectAnalysisResult + { + Project = firstProject.Project, + Diagnostics = _loadDiagnostics.Concat(firstProject.Diagnostics).ToList() + }; + } + + return new SolutionAnalysisResult + { + Solution = solution, + ProjectResults = projectResults + }; + } - public void Dispose() - { - if (_workspace.IsValueCreated) _workspace.GetValueAsync().Dispose(); + private async Task AnalyzeProjectAsync(Project project) + { + Compilation? compilation = await project.GetCompilationAsync(); + if (compilation is null) + { + return new ProjectAnalysisResult + { + Project = project, + Diagnostics = new List() + }; + } + + ImmutableArray compileDiagnostics = compilation.GetDiagnostics(); + + var analyzers = project.AnalyzerReferences + .SelectMany(r => r.GetAnalyzersForAllLanguages()) + .ToImmutableArray(); + + ImmutableArray analyzerDiagnostics = ImmutableArray.Empty; + if (!analyzers.IsEmpty) + { + var compWithAnalyzers = compilation.WithAnalyzers(analyzers); + analyzerDiagnostics = await compWithAnalyzers.GetAllDiagnosticsAsync(); + } + + var allDiagnostics = compileDiagnostics + .Concat(analyzerDiagnostics) + .ToList(); + + return new ProjectAnalysisResult + { + Project = project, + Diagnostics = allDiagnostics + }; + } + + private void HandleWorkspaceFailure(object? sender, WorkspaceDiagnosticEventArgs e) + { + if (e.Diagnostic.Kind == WorkspaceDiagnosticKind.Failure && + !e.Diagnostic.Message.Contains("SDK Resolver Failure") && + !e.Diagnostic.Message.Contains(".NETFramework,Version=v4.8")) + { + var diagnostic = Diagnostic.Create( + id: e.Diagnostic.Kind.ToString(), + category: "Workspace", + message: e.Diagnostic.Message, + severity: DiagnosticSeverity.Error, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + warningLevel: 0); + _loadDiagnostics.Add(diagnostic); + } + else if (e.Diagnostic.Kind == WorkspaceDiagnosticKind.Warning) + { + var diagnostic = Diagnostic.Create( + id: e.Diagnostic.Kind.ToString(), + category: "Workspace", + message: e.Diagnostic.Message, + severity: DiagnosticSeverity.Warning, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + warningLevel: 1); + _loadDiagnostics.Add(diagnostic); + } + } + + private async Task RunDotnetRestoreAsync(string path) + { + var processStartInfo = new ProcessStartInfo + { + FileName = "dotnet", + Arguments = $"restore \"{path}\"", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + }; + + using var process = new Process { StartInfo = processStartInfo }; + var output = new StringBuilder(); + var error = new StringBuilder(); + process.OutputDataReceived += (sender, args) => { if (args.Data != null) output.AppendLine(args.Data); }; + process.ErrorDataReceived += (sender, args) => { if (args.Data != null) error.AppendLine(args.Data); }; + process.Start(); + process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + await process.WaitForExitAsync(); + if (process.ExitCode != 0) + { + throw new InvalidOperationException( + $"dotnet restore failed with exit code {process.ExitCode}.\n" + + $"Error: {error}"); + } + } } } \ No newline at end of file diff --git a/Tests/TestRunners/MultiFileTestFixture.cs b/Tests/TestRunners/MultiFileTestFixture.cs index c5bb6f14..32abaa9f 100644 --- a/Tests/TestRunners/MultiFileTestFixture.cs +++ b/Tests/TestRunners/MultiFileTestFixture.cs @@ -41,7 +41,7 @@ public sealed class MultiFileTestFixture : ICollectionFixture shouldConvertProject, Language targetLanguage, [CallerMemberName] string expectedResultsDirectory = "") { From 4c94be2d94e4d8f98958fad9b819cf2e1c09bf23 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:09:13 +0000 Subject: [PATCH 21/41] Reintegrate existing logic --- .../MSBuildWorkspaceConverter.cs | 173 ++++++++---------- 1 file changed, 78 insertions(+), 95 deletions(-) diff --git a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs index bf76ceff..a023f873 100644 --- a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs +++ b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs @@ -1,17 +1,23 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.ComponentModel.DataAnnotations; using System.Diagnostics; using System.IO; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.MSBuild; -using Microsoft.CodeAnalysis.Diagnostics; using ICSharpCode.CodeConverter; using ICSharpCode.CodeConverter.Common; +using ICSharpCode.CodeConverter.CSharp; +using ICSharpCode.CodeConverter.Util; +using ICSharpCode.CodeConverter.VB; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; +using Microsoft.CodeAnalysis.MSBuild; +using Microsoft.VisualStudio.Threading; namespace ICSharpCode.CodeConverter.CommandLine; @@ -20,81 +26,62 @@ namespace ICSharpCode.CodeConverter.CommandLine; /// public sealed class MsBuildWorkspaceConverter { - private readonly string _solutionFilePath; + private readonly SolutionLoader _solutionLoader; + private AsyncLazy? _cachedSolution; + // The other parameters are ignored for compatibility - public MsBuildWorkspaceConverter(string solutionFilePath, bool isNetCore, object joinableTaskFactory, bool bestEffortConversion = false, Dictionary? buildProps = null) + public MsBuildWorkspaceConverter(string solutionFilePath, bool bestEffortConversion = false, Dictionary? buildProps = null) { - _solutionFilePath = solutionFilePath; + _solutionLoader = new SolutionLoader(solutionFilePath, bestEffortConversion, buildProps); } - /// - /// Maintains compatibility: yields a ConversionResult for each diagnostic in the solution. - /// - public async IAsyncEnumerable ConvertProjectsWhereAsync( - Func shouldConvertProject, - Language? targetLanguage, - IProgress progress, - [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken token) + + public async IAsyncEnumerable ConvertProjectsWhereAsync(Func shouldConvertProject, Language? targetLanguage, IProgress progress, [EnumeratorCancellation] CancellationToken token) { - var analysis = await AnalyzeSolutionAsync(_solutionFilePath); - foreach (var projectResult in analysis.ProjectResults) - { - if (!shouldConvertProject(projectResult.Project)) continue; - foreach (var diag in projectResult.Diagnostics) - { - var result = new ConversionResult(new Exception(diag.ToString())) - { - SourcePathOrNull = projectResult.Project.FilePath - }; - yield return result; - } + var strProgress = new Progress(s => progress.Report(new ConversionProgress(s))); +#pragma warning disable VSTHRD012 // Provide JoinableTaskFactory where allowed - Shouldn't need main thread, and I can't access ThreadHelper without referencing VS shell. + _cachedSolution ??= new AsyncLazy(async () => await _solutionLoader.AnalyzeSolutionAsync(strProgress)); +#pragma warning restore VSTHRD012 // Provide JoinableTaskFactory where allowed + var solution = await _cachedSolution.GetValueAsync(token); + + if (!targetLanguage.HasValue) { + targetLanguage = solution.Projects.Any(p => p.Language == LanguageNames.VisualBasic) ? Language.CS : Language.VB; } - } - /// - /// Analyzes a complete .NET solution (.sln) file and returns diagnostics for all projects. - /// - /// The absolute path to the .sln file. - /// The build configuration (e.g., "Debug" or "Release"). - /// A SolutionAnalysisResult containing all projects and diagnostics. - public async Task AnalyzeSolutionAsync(string solutionPath, string configuration = "Debug") - { - var analyzer = new SolutionAnalyzer(); - return await analyzer.AnalyzeSolutionAsync(solutionPath, configuration); + var languageConversion = targetLanguage == Language.CS + ? (ILanguageConversion)new VBToCSConversion() + : new CSToVBConversion(); + languageConversion.ConversionOptions = new ConversionOptions { AbandonOptionalTasksAfter = TimeSpan.FromHours(4) }; + var languageNameToConvert = targetLanguage == Language.CS + ? LanguageNames.VisualBasic + : LanguageNames.CSharp; + + var projectsToConvert = solution.Projects.Where(p => p.Language == languageNameToConvert && shouldConvertProject(p)).ToArray(); + var results = SolutionConverter.CreateFor(languageConversion, projectsToConvert, progress, token).ConvertAsync(); + await foreach (var r in results.WithCancellation(token)) yield return r; } - /// - /// A container for the results of a full solution analysis. - /// - public class SolutionAnalysisResult + private class SolutionLoader { - public Solution Solution { get; set; } = null!; - public List ProjectResults { get; set; } = new List(); - public IEnumerable AllDiagnostics => ProjectResults.SelectMany(p => p.Diagnostics); - } + private readonly string _solutionFilePath; + private readonly bool _bestEffort; + private readonly IDictionary _buildProps; - /// - /// A container for the results of a single project analysis. - /// - public class ProjectAnalysisResult - { - public Project Project { get; set; } = null!; - public IReadOnlyList Diagnostics { get; set; } = Array.Empty(); - } - - private class SolutionAnalyzer - { - private readonly List _loadDiagnostics = new(); + public SolutionLoader(string solutionFilePath, bool bestEffort, IDictionary? buildProps) + { + _solutionFilePath = solutionFilePath; + _bestEffort = bestEffort; + _buildProps = buildProps ?? new Dictionary(); + } - public async Task AnalyzeSolutionAsync(string solutionPath, string configuration = "Debug") + public async Task AnalyzeSolutionAsync(IProgress progress, string configuration = "Debug") { + progress.Report($"Running dotnet restore on {_solutionFilePath}"); // === PREREQUISITE: Run 'dotnet restore' === - await RunDotnetRestoreAsync(solutionPath); - - _loadDiagnostics.Clear(); + await RunDotnetRestoreAsync(_solutionFilePath); // === STEP 1: Create and Configure Workspace === - var properties = new Dictionary + var properties = new Dictionary(_buildProps) { { "Configuration", configuration }, { "RunAnalyzers", "true" }, @@ -107,49 +94,49 @@ public async Task AnalyzeSolutionAsync(string solutionPa Solution solution; try { - solution = await workspace.OpenSolutionAsync(solutionPath); + solution = await workspace.OpenSolutionAsync(_solutionFilePath); } finally { workspace.WorkspaceFailed -= HandleWorkspaceFailure; } - // === STEP 2: Analyze Each Project === - var projectResults = new List(); - foreach (var project in solution.Projects) - { - var projectResult = await AnalyzeProjectAsync(project); - projectResults.Add(projectResult); + var errorString = await GetCompilationErrorsAsync(workspace, solution.Projects); + if (string.IsNullOrEmpty(errorString)) return solution; + errorString = " " + errorString.Replace(Environment.NewLine, Environment.NewLine + " "); + progress.Report($"Compilation errors found before conversion.:{Environment.NewLine}{errorString}"); + + if (_bestEffort) { + progress.Report("Attempting best effort conversion on broken input due to override"); + } else { + throw CreateException("Fix compilation errors before conversion for an accurate conversion, or as a last resort, use the best effort conversion option", errorString); } - // Include load diagnostics in the first project or create a dummy entry - if (projectResults.Count > 0 && _loadDiagnostics.Any()) + return solution; + + ValidationException CreateException(string mainMessage, string fullDetail) { - var firstProject = projectResults[0]; - projectResults[0] = new ProjectAnalysisResult - { - Project = firstProject.Project, - Diagnostics = _loadDiagnostics.Concat(firstProject.Diagnostics).ToList() - }; + return new ValidationException($"{mainMessage}:{Environment.NewLine}{fullDetail}{Environment.NewLine}{mainMessage}"); } + } - return new SolutionAnalysisResult - { - Solution = solution, - ProjectResults = projectResults - }; + private async Task GetCompilationErrorsAsync(MSBuildWorkspace workspace, IEnumerable projectsToConvert) + { + var workspaceErrors = workspace.Diagnostics.GetErrorString(); + var errors = await projectsToConvert.ParallelSelectAwaitAsync(async x => { + var c = await x.GetCompilationAsync() ?? throw new InvalidOperationException($"Compilation could not be created for {x.Language}"); + return new[] { CompilationWarnings.WarningsForCompilation(c, c.AssemblyName) }; + }, Env.MaxDop).ToArrayAsync(); + var errorString = string.Join("\r\n", workspaceErrors.Yield().Concat(errors.SelectMany(w => w)).Where(w => w != null)); + return errorString; } - private async Task AnalyzeProjectAsync(Project project) + private async Task> GetDiagnosticsAsync(Project project) { Compilation? compilation = await project.GetCompilationAsync(); - if (compilation is null) - { - return new ProjectAnalysisResult - { - Project = project, - Diagnostics = new List() - }; + if (compilation is null) { + var collection = Diagnostic.Create("FAIL", "Compilation", "Compilation is null", DiagnosticSeverity.Error, DiagnosticSeverity.Error, true, 3); + return new List {collection}; } ImmutableArray compileDiagnostics = compilation.GetDiagnostics(); @@ -169,11 +156,7 @@ private async Task AnalyzeProjectAsync(Project project) .Concat(analyzerDiagnostics) .ToList(); - return new ProjectAnalysisResult - { - Project = project, - Diagnostics = allDiagnostics - }; + return allDiagnostics; } private void HandleWorkspaceFailure(object? sender, WorkspaceDiagnosticEventArgs e) From b1131490170812c6333f0bb15f7e68d67cb0dddb Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:09:43 +0000 Subject: [PATCH 22/41] Remove superfluous - todo check if there were any extra failure types caught in it --- .../MSBuildWorkspaceConverter.cs | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs index a023f873..b81d54bf 100644 --- a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs +++ b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs @@ -131,64 +131,6 @@ private async Task GetCompilationErrorsAsync(MSBuildWorkspace workspace, return errorString; } - private async Task> GetDiagnosticsAsync(Project project) - { - Compilation? compilation = await project.GetCompilationAsync(); - if (compilation is null) { - var collection = Diagnostic.Create("FAIL", "Compilation", "Compilation is null", DiagnosticSeverity.Error, DiagnosticSeverity.Error, true, 3); - return new List {collection}; - } - - ImmutableArray compileDiagnostics = compilation.GetDiagnostics(); - - var analyzers = project.AnalyzerReferences - .SelectMany(r => r.GetAnalyzersForAllLanguages()) - .ToImmutableArray(); - - ImmutableArray analyzerDiagnostics = ImmutableArray.Empty; - if (!analyzers.IsEmpty) - { - var compWithAnalyzers = compilation.WithAnalyzers(analyzers); - analyzerDiagnostics = await compWithAnalyzers.GetAllDiagnosticsAsync(); - } - - var allDiagnostics = compileDiagnostics - .Concat(analyzerDiagnostics) - .ToList(); - - return allDiagnostics; - } - - private void HandleWorkspaceFailure(object? sender, WorkspaceDiagnosticEventArgs e) - { - if (e.Diagnostic.Kind == WorkspaceDiagnosticKind.Failure && - !e.Diagnostic.Message.Contains("SDK Resolver Failure") && - !e.Diagnostic.Message.Contains(".NETFramework,Version=v4.8")) - { - var diagnostic = Diagnostic.Create( - id: e.Diagnostic.Kind.ToString(), - category: "Workspace", - message: e.Diagnostic.Message, - severity: DiagnosticSeverity.Error, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - warningLevel: 0); - _loadDiagnostics.Add(diagnostic); - } - else if (e.Diagnostic.Kind == WorkspaceDiagnosticKind.Warning) - { - var diagnostic = Diagnostic.Create( - id: e.Diagnostic.Kind.ToString(), - category: "Workspace", - message: e.Diagnostic.Message, - severity: DiagnosticSeverity.Warning, - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - warningLevel: 1); - _loadDiagnostics.Add(diagnostic); - } - } - private async Task RunDotnetRestoreAsync(string path) { var processStartInfo = new ProcessStartInfo From 3966664f9e84c5c134e7e23d70539deeb90c307d Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:13:07 +0000 Subject: [PATCH 23/41] Get compilable --- .../CodeConv.Shared/CodeConvProgram.cs | 2 +- .../MSBuildWorkspaceConverter.cs | 28 +++++-------------- Tests/TestRunners/MultiFileTestFixture.cs | 2 +- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/CommandLine/CodeConv.Shared/CodeConvProgram.cs b/CommandLine/CodeConv.Shared/CodeConvProgram.cs index 1463b713..3f148af6 100644 --- a/CommandLine/CodeConv.Shared/CodeConvProgram.cs +++ b/CommandLine/CodeConv.Shared/CodeConvProgram.cs @@ -150,7 +150,7 @@ private async Task ConvertAsync(IProgress progress, Cancella var properties = ParsedProperties(); var joinableTaskFactory = new JoinableTaskFactory(new JoinableTaskContext()); - var msbuildWorkspaceConverter = new MsBuildWorkspaceConverter(finalSolutionPath, CoreOnlyProjects, joinableTaskFactory, BestEffort, properties); + var msbuildWorkspaceConverter = new MsBuildWorkspaceConverter(joinableTaskFactory, finalSolutionPath, BestEffort, properties); var converterResultsEnumerable = msbuildWorkspaceConverter.ConvertProjectsWhereAsync(ShouldIncludeProject, TargetLanguage, progress, cancellationToken); await ConversionResultWriter.WriteConvertedAsync(converterResultsEnumerable, finalSolutionPath, outputDirectory, Force, true, strProgress, cancellationToken); diff --git a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs index b81d54bf..312f7864 100644 --- a/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs +++ b/CommandLine/CodeConv.Shared/MSBuildWorkspaceConverter.cs @@ -1,21 +1,17 @@ using System; using System.Collections.Generic; -using System.Collections.Immutable; using System.ComponentModel.DataAnnotations; using System.Diagnostics; -using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; -using ICSharpCode.CodeConverter; using ICSharpCode.CodeConverter.Common; using ICSharpCode.CodeConverter.CSharp; using ICSharpCode.CodeConverter.Util; using ICSharpCode.CodeConverter.VB; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.MSBuild; using Microsoft.VisualStudio.Threading; @@ -26,12 +22,14 @@ namespace ICSharpCode.CodeConverter.CommandLine; /// public sealed class MsBuildWorkspaceConverter { + private readonly JoinableTaskFactory _joinableTaskFactory; private readonly SolutionLoader _solutionLoader; private AsyncLazy? _cachedSolution; // The other parameters are ignored for compatibility - public MsBuildWorkspaceConverter(string solutionFilePath, bool bestEffortConversion = false, Dictionary? buildProps = null) + public MsBuildWorkspaceConverter(JoinableTaskFactory joinableTaskFactory, string solutionFilePath, bool bestEffortConversion = false, Dictionary? buildProps = null) { + _joinableTaskFactory = joinableTaskFactory; _solutionLoader = new SolutionLoader(solutionFilePath, bestEffortConversion, buildProps); } @@ -39,14 +37,11 @@ public MsBuildWorkspaceConverter(string solutionFilePath, bool bestEffortConvers public async IAsyncEnumerable ConvertProjectsWhereAsync(Func shouldConvertProject, Language? targetLanguage, IProgress progress, [EnumeratorCancellation] CancellationToken token) { var strProgress = new Progress(s => progress.Report(new ConversionProgress(s))); -#pragma warning disable VSTHRD012 // Provide JoinableTaskFactory where allowed - Shouldn't need main thread, and I can't access ThreadHelper without referencing VS shell. - _cachedSolution ??= new AsyncLazy(async () => await _solutionLoader.AnalyzeSolutionAsync(strProgress)); -#pragma warning restore VSTHRD012 // Provide JoinableTaskFactory where allowed + _cachedSolution ??= new AsyncLazy(async () => await _solutionLoader.AnalyzeSolutionAsync(strProgress), _joinableTaskFactory); + var solution = await _cachedSolution.GetValueAsync(token); - if (!targetLanguage.HasValue) { - targetLanguage = solution.Projects.Any(p => p.Language == LanguageNames.VisualBasic) ? Language.CS : Language.VB; - } + targetLanguage ??= solution.Projects.Any(p => p.Language == LanguageNames.VisualBasic) ? Language.CS : Language.VB; var languageConversion = targetLanguage == Language.CS ? (ILanguageConversion)new VBToCSConversion() @@ -89,17 +84,8 @@ public async Task AnalyzeSolutionAsync(IProgress progress, str }; using var workspace = MSBuildWorkspace.Create(properties); - workspace.WorkspaceFailed += HandleWorkspaceFailure; - Solution solution; - try - { - solution = await workspace.OpenSolutionAsync(_solutionFilePath); - } - finally - { - workspace.WorkspaceFailed -= HandleWorkspaceFailure; - } + Solution solution = await workspace.OpenSolutionAsync(_solutionFilePath); var errorString = await GetCompilationErrorsAsync(workspace, solution.Projects); if (string.IsNullOrEmpty(errorString)) return solution; diff --git a/Tests/TestRunners/MultiFileTestFixture.cs b/Tests/TestRunners/MultiFileTestFixture.cs index 32abaa9f..04f5c1f5 100644 --- a/Tests/TestRunners/MultiFileTestFixture.cs +++ b/Tests/TestRunners/MultiFileTestFixture.cs @@ -41,7 +41,7 @@ public sealed class MultiFileTestFixture : ICollectionFixture shouldConvertProject, Language targetLanguage, [CallerMemberName] string expectedResultsDirectory = "") { From a5c311d9b747e82a60d3a9329fbef13ccdf96b05 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:33:37 +0000 Subject: [PATCH 24/41] Prepare for .NET 10 upgrade --- CodeConverter/CodeConverter.csproj | 3 ++- Func/Func.csproj | 1 + Vsix/Vsix.csproj | 3 +++ Web/Web.csproj | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CodeConverter/CodeConverter.csproj b/CodeConverter/CodeConverter.csproj index 05726a60..a348df91 100644 --- a/CodeConverter/CodeConverter.csproj +++ b/CodeConverter/CodeConverter.csproj @@ -58,7 +58,8 @@ - + + all diff --git a/Func/Func.csproj b/Func/Func.csproj index b9b9d570..18ace947 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -36,6 +36,7 @@ + diff --git a/Vsix/Vsix.csproj b/Vsix/Vsix.csproj index 7f1bb0e5..04b58492 100644 --- a/Vsix/Vsix.csproj +++ b/Vsix/Vsix.csproj @@ -70,6 +70,9 @@ 4.8.6 + + 10.0.0 + diff --git a/Web/Web.csproj b/Web/Web.csproj index 428c8acf..fd1fa39b 100644 --- a/Web/Web.csproj +++ b/Web/Web.csproj @@ -23,6 +23,7 @@ + From 4c91085c23f1a4e3b5c2d4bf37f373b2e6ae4701 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:34:25 +0000 Subject: [PATCH 25/41] Store final changes for step 'Validate that a .NET 10.0 SDK required for this upgrade is installed on the machine and if not, help to get it installed' --- .github/upgrades/dotnet-upgrade-plan.md | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/upgrades/dotnet-upgrade-plan.md diff --git a/.github/upgrades/dotnet-upgrade-plan.md b/.github/upgrades/dotnet-upgrade-plan.md new file mode 100644 index 00000000..4bfc87cb --- /dev/null +++ b/.github/upgrades/dotnet-upgrade-plan.md @@ -0,0 +1,34 @@ +# .NET 10 Upgrade Plan + +## Execution Steps + +Execute steps below sequentially one by one in the order they are listed. + +1. Validate that a .NET 10.0 SDK required for this upgrade is installed on the machine and if not, help to get it installed. +2. Ensure that the SDK version specified in global.json files is compatible with the .NET 10.0 upgrade. +3. Upgrade CSharpNetStandardLib/CSharpNetStandardLib.csproj +4. Upgrade ConsoleApp2/CSharpConsoleApp.csproj +5. Upgrade ConsoleApp1/VisualBasicConsoleApp.vbproj + +## Settings + +### Project upgrade details + +#### CSharpNetStandardLib/CSharpNetStandardLib.csproj modifications + +Project properties changes: + - Target framework should be changed from `netstandard2.0` to `net10.0` + +#### ConsoleApp2/CSharpConsoleApp.csproj modifications + +Project file needs to be converted to SDK-style format. + +Project properties changes: + - Target framework should be changed from `.NETFramework,Version=v4.8` to `net10.0` + +#### ConsoleApp1/VisualBasicConsoleApp.vbproj modifications + +Project file needs to be converted to SDK-style format. + +Project properties changes: + - Target framework should be changed from `.NETFramework,Version=v4.8` to `net10.0` From 0ea37573a2b19f631050e008f4f5aac217abe961 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:34:44 +0000 Subject: [PATCH 26/41] Modernize CSharpConsoleApp.csproj to SDK-style format Converted CSharpConsoleApp.csproj from the legacy .NET Framework project format to the modern SDK-style format. Updated the target framework to net10.0, removed redundant property groups and references, and simplified the ProjectReference element. This streamlines the project file and aligns it with current .NET best practices. --- .../ConsoleApp2/CSharpConsoleApp.csproj | 49 ++----------------- 1 file changed, 3 insertions(+), 46 deletions(-) diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj index 85b50bfa..5615c608 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj @@ -1,62 +1,19 @@ - - - + - Debug - AnyCPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41} + net10.0 Exe ConsoleApp2 ConsoleApp2 - v4.8 - 512 - true - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 bin\Debug\ConsoleApp2.xml - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - {4de39d59-19c6-4e1e-910c-5ea8ba55348b} - CSharpNetStandardLib - + - \ No newline at end of file From 38fc8f88cbb58de2b985a46985eeae45673c8ae3 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:34:46 +0000 Subject: [PATCH 27/41] Remove unused references from CSharpConsoleApp.csproj Eliminated references to microsoft.visualbasic, System.Data.DataSetExtensions, and Microsoft.CSharp from the CSharpConsoleApp.csproj file, streamlining project dependencies. No other changes were made. --- .../SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj index 5615c608..d6bc176d 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj @@ -8,11 +8,6 @@ bin\Debug\ConsoleApp2.xml - - - - - From 43f4995f60acd30ea8256337bed9489784e16431 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:35:19 +0000 Subject: [PATCH 28/41] Store final changes for step 'Upgrade ConsoleApp2/CSharpConsoleApp.csproj' --- .../ConsoleApp2/CSharpConsoleApp.csproj | 1 + .../ConsoleApp2/Properties/AssemblyInfo.cs | 36 ------------------- .../ConsoleApp2/Properties/AssemblyInfo.vb | 16 --------- 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj index d6bc176d..f769d00e 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj @@ -4,6 +4,7 @@ Exe ConsoleApp2 ConsoleApp2 + false bin\Debug\ConsoleApp2.xml diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs deleted file mode 100644 index 8fc583c8..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ConsoleApp2")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConsoleApp2")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b7602e54-8f45-4dc4-88b5-e11cdc7e8b41")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb deleted file mode 100644 index 80799465..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,16 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.CompilerServices -Imports System.Runtime.InteropServices - - - - - - - - - - - - - From 72aac81e22cb9b9176736cbcad16fdb0630f33f5 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:41:40 +0000 Subject: [PATCH 29/41] Move these test projs to dot net 10 and net standard --- .../CharacterizationTestSolution.sln | 14 +-- .../SourceFiles/ConsoleApp1/App.config | 6 - .../My Project/Application.Designer.cs | 21 ---- .../My Project/Application.Designer.vb | 13 -- .../ConsoleApp1/My Project/Application.myapp | 10 -- .../ConsoleApp1/My Project/AssemblyInfo.cs | 25 ---- .../ConsoleApp1/My Project/AssemblyInfo.vb | 35 ------ .../My Project/Resources.Designer.cs | 74 ----------- .../My Project/Resources.Designer.vb | 63 ---------- .../ConsoleApp1/My Project/Resources.resx | 117 ----------------- .../My Project/Settings.Designer.cs | 61 --------- .../My Project/Settings.Designer.vb | 73 ----------- .../ConsoleApp1/My Project/Settings.settings | 7 -- .../ConsoleApp1/VisualBasicConsoleApp.vbproj | 117 ----------------- .../ConsoleApp2/CSharpConsoleApp.csproj | 3 + .../My Project/AssemblyInfo.vb | 35 ------ .../My Project/Settings.Designer.vb | 5 +- .../Prefix.VbLibrary/Prefix.VbLibrary.vbproj | 119 ++---------------- .../AVbClass.vb | 0 .../VisualBasicConsoleApp.vbproj | 13 ++ 20 files changed, 33 insertions(+), 778 deletions(-) delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/App.config delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.settings delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj delete mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb rename Tests/TestData/MultiFileCharacterization/SourceFiles/{ConsoleApp1 => VisualBasicConsoleApp}/AVbClass.vb (100%) create mode 100644 Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln index bcada55d..7564beac 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/CharacterizationTestSolution.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.0.11205.157 d18.0 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject @@ -22,10 +22,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" -EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -60,14 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/App.config b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/App.config deleted file mode 100644 index a86c6465..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs deleted file mode 100644 index fe8d8ce9..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.cs +++ /dev/null @@ -1,21 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb deleted file mode 100644 index 88dd01c7..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp deleted file mode 100644 index e62f1a53..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 2 - true - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs deleted file mode 100644 index 5f579fc1..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("ConsoleApp1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConsoleApp1")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: ComVisible(false)] -[assembly: Guid("3130b95d-a38c-416f-a353-cd75539cbe19")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb deleted file mode 100644 index 000d88b1..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs deleted file mode 100644 index 8a4b4bdb..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; - - -namespace My.Resources -{ - - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// [global::System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCode()] - [global::System.Runtime.CompilerServices.CompilerGenerated()] - [global::Microsoft.VisualBasic.HideModuleName()] - internal static class Resources - { - private global::System.Resources.ResourceManager resourceMan; - - private global::System.Globalization.CultureInfo resourceCulture; - - /// - /// Returns the cached ResourceManager instance used by this class. - /// [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ConsoleApp1.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb deleted file mode 100644 index a1b90034..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.Designer.vb +++ /dev/null @@ -1,63 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ConsoleApp1.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx deleted file mode 100644 index ea9cbcdb..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs deleted file mode 100644 index e87943a6..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.cs +++ /dev/null @@ -1,61 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Threading.Tasks; -using System.Data; -using System.Diagnostics; -using Microsoft.VisualBasic; -using System.Linq; -using System.Collections.Generic; -using System.Collections; -using System; -using System.Xml.Linq; - - -namespace My -{ - [global::System.Runtime.CompilerServices.CompilerGenerated()] - [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : global::System.Configuration.ApplicationSettingsBase - { - private static MySettings defaultInstance = (MySettings)global::System.Configuration.ApplicationSettingsBase.Synchronized(new MySettings()); - - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - public static MySettings Default - { - get - { - - /* TODO ERROR: Skipped IfDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */ - return defaultInstance; - } - } - } -} - -namespace My -{ - [global::Microsoft.VisualBasic.HideModuleName()] - [global::System.Diagnostics.DebuggerNonUserCode()] - [global::System.Runtime.CompilerServices.CompilerGenerated()] - internal static class MySettingsProperty - { - [global::System.ComponentModel.Design.HelpKeyword("My.Settings")] - internal static global::ConsoleApp1.My.MySettings Settings - { - get - { - return global::ConsoleApp1.My.MySettings.Default; - } - } - } -} - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb deleted file mode 100644 index 62478ad1..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:4.0.30319.42000 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.ConsoleApp1.My.MySettings - Get - Return Global.ConsoleApp1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.settings b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.settings deleted file mode 100644 index 85b890b3..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj deleted file mode 100644 index 67b2b112..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/VisualBasicConsoleApp.vbproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - - - AnyCPU - true - full - true - true - bin\Debug\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - {b7602e54-8f45-4dc4-88b5-e11cdc7e8b41} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj index f769d00e..07c774bc 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp2/CSharpConsoleApp.csproj @@ -12,4 +12,7 @@ + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb deleted file mode 100644 index 20ae9495..00000000 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb index 9678afcb..31607499 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/My Project/Settings.Designer.vb @@ -18,9 +18,6 @@ Namespace My Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then @@ -50,7 +47,7 @@ Namespace My End SyncLock End If #End If - Return defaultInstance + Return Nothing End Get End Property End Class diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj index d44d68b8..f4f13223 100644 --- a/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/Prefix.VbLibrary/Prefix.VbLibrary.vbproj @@ -1,111 +1,10 @@ - - - - - Debug - AnyCPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A} - Library - Prefix.VbLibrary - Prefix.VbLibrary - 512 - Windows - v4.8 - true - - - - true - full - true - true - bin\Debug\ - Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - + + + + Prefix.VbLibrary + netstandard2.1 + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/AVbClass.vb b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/AVbClass.vb similarity index 100% rename from Tests/TestData/MultiFileCharacterization/SourceFiles/ConsoleApp1/AVbClass.vb rename to Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/AVbClass.vb diff --git a/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj new file mode 100644 index 00000000..bd110e6d --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/SourceFiles/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj @@ -0,0 +1,13 @@ + + + + Exe + VisualBasicConsoleApp + net10.0 + + + + + + + From c28f81d1891d0151b71f0651799f0e2e52a3e264 Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 21:51:09 +0000 Subject: [PATCH 30/41] Totally overwrite previous output of these tests --- .../CharacterizationTestSolution.sln | 26 +- .../ConsoleApp1/VisualBasicConsoleApp.vbproj | 117 - .../ConsoleApp2/CSharpConsoleApp.vbproj | 56 +- .../ConsoleApp2/Properties/AssemblyInfo.vb | 35 - .../VisualBasicConsoleApp.vbproj | 13 + .../CharacterizationTestSolution.sln | 26 +- .../ConsoleApp1/VisualBasicConsoleApp.vbproj | 117 - .../ConsoleApp2/CSharpConsoleApp.vbproj | 56 +- .../ConsoleApp2/Properties/AssemblyInfo.vb | 35 - .../NetCore/NetCore.vbproj | 2 +- .../VisualBasicConsoleApp.vbproj | 13 + .../CharacterizationTestSolution.sln | 26 +- .../CharacterizationTestSolution.sln | 90 - .../ByRefArgument.cs | 39 - .../My Project/Application.Designer.cs | 11 - .../My Project/AssemblyInfo.cs | 35 - .../MyNamespace.Static.1.Designer.cs | 468 ---- .../MyNamespace.Static.2.Designer.cs | 242 -- .../MyNamespace.Static.3.Designer.cs | 16 - .../My Project/Settings.Designer.cs | 88 - .../Resources.Designer.cs | 70 - .../Resources.resx | 117 - .../VisualBasicUsingCSharpRefReturn.csproj | 115 - .../WithRefReturnStructure.cs | 41 - .../CharacterizationTestSolution.sln | 26 +- .../My Project/Application.Designer.cs | 11 - .../ConsoleApp1/My Project/AssemblyInfo.cs | 35 - .../MyNamespace.Static.1.Designer.cs | 470 ---- .../My Project/Settings.Designer.cs | 88 - .../ConsoleApp1/Resources.Designer.cs | 70 - .../ConsoleApp1/Resources.resx | 117 - .../ConsoleApp1/VisualBasicConsoleApp.csproj | 121 - .../ConsoleApp4/ConsoleApp4.csproj | 2 +- .../My Project/AssemblyInfo.cs | 35 - .../MyNamespace.Static.1.Designer.cs | 464 +--- .../MyNamespace.Static.2.Designer.cs | 1974 +++++++++++++++-- .../MyNamespace.Static.3.Designer.cs | 234 +- .../{ => My Project}/Resources.Designer.cs | 0 .../My Project/Settings.Designer.cs | 6 +- .../Prefix.VbLibrary/Prefix.VbLibrary.csproj | 112 +- .../Prefix.VbLibrary/Resources.resx | 117 - .../AVbClass.cs | 2 +- .../MyNamespace.Static.1.Designer.cs | 385 ++++ .../MyNamespace.Static.2.Designer.cs | 3 +- .../MyNamespace.Static.3.Designer.cs | 0 .../VisualBasicConsoleApp.csproj | 13 + .../WinFormsAppVb/ApplicationEvents.cs | 30 + .../Folder/FolderForm.Designer.cs | 2 +- .../Folder/FolderForm.cs | 2 +- .../Folder}/Resource2.Designer.cs | 4 +- .../Folder2}/Resource3.Designer.cs | 4 +- .../WinFormsAppVb/Form1.Designer.cs | 44 + .../WinFormsAppVb/Form1.cs | 12 + .../My Project/Application.Designer.cs | 2 +- .../MyNamespace.Dynamic.Designer.cs | 25 +- .../MyNamespace.Static.1.Designer.cs | 2 +- .../MyNamespace.Static.2.Designer.cs | 2 +- .../MyNamespace.Static.3.Designer.cs | 0 .../My Project}/Resources.Designer.cs | 2 +- .../My Project/Settings.Designer.cs | 4 +- .../ReferencingFormThroughStatic.cs | 2 +- .../Resource1.Designer.cs | 4 +- .../Resource1.en-US.Designer.cs | 0 .../WinFormsAppVb/WinFormsAppVb.csproj | 33 + .../WinformsDesignerTest.Designer.cs | 2 +- .../WinformsDesignerTest.cs | 2 +- .../WindowsAppVb/My Project/AssemblyInfo.cs | 35 - .../WindowsAppVb/Resource2.resx | 133 -- .../WindowsAppVb/Resource3.en-US.resx | 133 -- .../WindowsAppVb/Resource3.resx | 133 -- .../WindowsAppVb/Resources.resx | 130 -- .../WindowsAppVb/WindowsAppVb.csproj | 195 -- 72 files changed, 2686 insertions(+), 4390 deletions(-) delete mode 100644 Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj delete mode 100644 Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb create mode 100644 Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj delete mode 100644 Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj delete mode 100644 Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb create mode 100644 Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/{ => My Project}/Resources.Designer.cs (100%) delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{ConsoleApp1 => VisualBasicConsoleApp}/AVbClass.cs (75%) create mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{ConsoleApp1 => VisualBasicConsoleApp}/My Project/MyNamespace.Static.2.Designer.cs (99%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{ConsoleApp1 => VisualBasicConsoleApp}/My Project/MyNamespace.Static.3.Designer.cs (100%) create mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj create mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/Folder/FolderForm.Designer.cs (99%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/Folder/FolderForm.cs (98%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb/Folder}/Resource2.Designer.cs (97%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb/Folder2}/Resource3.Designer.cs (97%) create mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs create mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/My Project/Application.Designer.cs (98%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/My Project/MyNamespace.Dynamic.Designer.cs (70%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/My Project/MyNamespace.Static.1.Designer.cs (99%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/My Project/MyNamespace.Static.2.Designer.cs (99%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/My Project/MyNamespace.Static.3.Designer.cs (100%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb/My Project}/Resources.Designer.cs (98%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/My Project/Settings.Designer.cs (98%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/ReferencingFormThroughStatic.cs (96%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/Resource1.Designer.cs (97%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/Resource1.en-US.Designer.cs (100%) create mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/WinformsDesignerTest.Designer.cs (99%) rename Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/{WindowsAppVb => WinFormsAppVb}/WinformsDesignerTest.cs (99%) delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx delete mode 100644 Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln index 8ea27f22..2139fcfe 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.vbproj", "{0544AF3F-431D-0235-0AED-2B62BEE9BFE1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj deleted file mode 100644 index 98ea9f5e..00000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp1/VisualBasicConsoleApp.vbproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - - - AnyCPU - true - full - true - true - bin\Debug\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj index 24396561..aedd6664 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/CSharpConsoleApp.vbproj @@ -1,64 +1,20 @@ - - - + On - Debug - AnyCPU - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} + net10.0 Exe ConsoleApp2 - v4.8 - 512 - true - + false $(DefaultItemExcludes);$(ProjectDir)**\*.cs - AnyCPU - true - full - false - bin\Debug\ - DEBUG,TRACE - prompt - 4 - ConsoleApp2.xml + bin\Debug\ConsoleApp2.xml - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + - - {4de39d59-19c6-4e1e-910c-5ea8ba55348b} - CSharpNetStandardLib - + - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb deleted file mode 100644 index 971b5e0b..00000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/ConsoleApp2/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - - - - - - - - - -' Setting ComVisible to false makes the types in this assembly not visible -' to COM components. If you need to access a type in this assembly from -' COM, set the ComVisible attribute to true on that type. - - -' The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' [assembly: AssemblyVersion("1.0.*")] - - diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj new file mode 100644 index 00000000..7d82f25b --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertCSharpConsoleAppOnly/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj @@ -0,0 +1,13 @@ + + + + Exe + VisualBasicConsoleApp + net10.0 + + + + + + + diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln index d462a143..56531a01 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.vbproj", "{0544AF3F-431D-0235-0AED-2B62BEE9BFE1}" EndProject Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "NetCore", "NetCore\NetCore.vbproj", "{C19BD957-110D-079D-1F57-DFADBA5B4679}" @@ -24,7 +22,9 @@ Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0544AF3F-431D-0235-0AED-2B62BEE9BFE1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj deleted file mode 100644 index 98ea9f5e..00000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.vbproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - - Debug - AnyCPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - - - AnyCPU - true - full - true - true - bin\Debug\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - AnyCPU - pdbonly - false - true - true - bin\Release\ - ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj index 784de34a..e25f79f4 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/CSharpConsoleApp.vbproj @@ -1,64 +1,20 @@ - - - + On - Debug - AnyCPU - {0544AF3F-431D-0235-0AED-2B62BEE9BFE1} + net10.0 Exe ConsoleApp2 - v4.8 - 512 - true - + false $(DefaultItemExcludes);$(ProjectDir)**\*.cs - AnyCPU - true - full - false - bin\Debug\ - DEBUG,TRACE - prompt - 4 - ConsoleApp2.xml + bin\Debug\ConsoleApp2.xml - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - + - - {FFC71C32-D59E-01EF-1354-94D6D8C2002B} - CSharpNetStandardLib - + - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb deleted file mode 100644 index 971b5e0b..00000000 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/ConsoleApp2/Properties/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - - - - - - - - - -' Setting ComVisible to false makes the types in this assembly not visible -' to COM components. If you need to access a type in this assembly from -' COM, set the ComVisible attribute to true on that type. - - -' The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' [assembly: AssemblyVersion("1.0.*")] - - diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj index 7dac1f19..e7605459 100644 --- a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/NetCore/NetCore.vbproj @@ -2,7 +2,7 @@ On Exe - net472 + net10.0 $(DefaultItemExcludes);$(ProjectDir)**\*.cs \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj new file mode 100644 index 00000000..7d82f25b --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.vbproj @@ -0,0 +1,13 @@ + + + + Exe + VisualBasicConsoleApp + net10.0 + + + + + + + diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln index bb2bf81a..815d2303 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbLibraryOnly/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.vbproj", "{39455F38-4197-4C3A-BB70-4E647A538BBE}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.vbproj", "{C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39455F38-4197-4C3A-BB70-4E647A538BBE}.Release|Any CPU.Build.0 = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2784C8A-2BC8-4A76-BDEC-AC59F41E1894}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln deleted file mode 100644 index acd90255..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/CharacterizationTestSolution.sln +++ /dev/null @@ -1,90 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.vbproj", "{D18AB89D-1897-4779-A937-F48661E0B6B8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E8B06A8-42BC-4D2A-A769-66A2352F215E}" - ProjectSection(SolutionItems) = preProject - ユニコード.txt = ユニコード.txt - EndProjectSection -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbLibrary", "VbLibrary\VbLibrary.vbproj", "{23195658-FBE7-4A3E-B79D-91AAC2D428E7}" -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VbNetStandardLib", "VbNetStandardLib\VbNetStandardLib.vbproj", "{FBFBE639-A532-408A-960D-288E05FEEB0E}" -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "ConsoleApp4", "ConsoleApp4\ConsoleApp4.vbproj", "{68361F37-56E9-4B49-AFF3-F1AF9938A97F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSharpNetStandardLib\CSharpNetStandardLib.csproj", "{4DE39D59-19C6-4E1E-910C-5EA8BA55348B}" -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.vbproj", "{CFAB82CD-BA17-4F08-99E2-403FADB0C46A}" -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpRefReturn", "CSharpRefReturn\CSharpRefReturn.csproj", "{8B843547-F49D-40A2-8C4E-1B81D8C5D589}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicUsingCSharpRefReturn", "VisualBasicUsesCSharpRefReturn\VisualBasicUsingCSharpRefReturn.csproj", "{D0421946-845F-09E8-2545-DE3EB2218254}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18AB89D-1897-4779-A937-F48661E0B6B8}.Release|Any CPU.Build.0 = Release|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.Build.0 = Release|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73BF583C-DD55-486C-9D0F-15D3D8CC72D9}.Release|Any CPU.Build.0 = Release|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23195658-FBE7-4A3E-B79D-91AAC2D428E7}.Release|Any CPU.Build.0 = Release|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBFBE639-A532-408A-960D-288E05FEEB0E}.Release|Any CPU.Build.0 = Release|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68361F37-56E9-4B49-AFF3-F1AF9938A97F}.Release|Any CPU.Build.0 = Release|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4DE39D59-19C6-4E1E-910C-5EA8BA55348B}.Release|Any CPU.Build.0 = Release|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CFAB82CD-BA17-4F08-99E2-403FADB0C46A}.Release|Any CPU.Build.0 = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.Build.0 = Release|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0421946-845F-09E8-2545-DE3EB2218254}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {417600E1-EB0F-4AF6-9C2D-9F542F6AEE7A} - EndGlobalSection -EndGlobal diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs deleted file mode 100644 index d0bc1dcd..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/ByRefArgument.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.VisualBasic.CompilerServices; - -namespace VisualBasicUsesCSharpRefReturn -{ - public class ByRefArgument - { - public void UseArr() - { - var arrObj = default(object[]); - Modify(ref arrObj[0]); - - var arrInt = default(int[]); - var tmp = arrInt; - object argo = tmp[0]; - Modify(ref argo); - tmp[0] = Conversions.ToInteger(argo); - } - - public void UseRefReturn() - { - var lstObj = default(CSharpRefReturn.RefReturnList); - Modify(ref lstObj[0]); - Modify(ref lstObj.RefProperty); - - var lstInt = default(CSharpRefReturn.RefReturnList); - var tmp = lstInt; - object argo = tmp[0]; - Modify(ref argo); - tmp[0] = Conversions.ToInteger(argo); - object argo1 = lstInt.RefProperty; - Modify(ref argo1); - lstInt.RefProperty = Conversions.ToInteger(argo1); - } - - public void Modify(ref object o) - { - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs deleted file mode 100644 index 5e9e2a07..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Application.Designer.cs +++ /dev/null @@ -1,11 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - - diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs deleted file mode 100644 index c10fc5b9..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("VisualBasicUsesCSharpRefReturn")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VisualBasicUsesCSharpRefReturn")] -[assembly: AssemblyCopyright("Copyright © 2024")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("47520bc8-6837-4f63-9aef-0a252d368f05")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs deleted file mode 100644 index 259c509e..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.1.Designer.cs +++ /dev/null @@ -1,468 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using Microsoft.VisualBasic; - -/* TODO ERROR: Skipped IfDirectiveTrivia -#If TARGET = "module" AndAlso _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia -#Const _MYTYPE="Empty" -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE = "WindowsForms" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "WindowsForms" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then -*/ -/* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYWEBSERVICES = True -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYUSERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYCOMPUTERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYAPPLICATIONTYPE = "Windows" -*/ -/* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Console" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Web" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = False -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WebControl" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Custom" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE <> "Empty" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYTYPE = "Empty" - -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE <> "Empty" Then -*/ -namespace VisualBasicUsesCSharpRefReturn.My -{ - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - #If TARGET = "winexe" Then - _ - Friend Shared Sub Main(ByVal Args As String()) - Try - Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) - Finally - End Try - My.Application.Run(Args) - End Sub - #End If - - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Windows" Then - */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Console" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYAPPLICATIONTYPE = "WindowsForms" - */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE = "Windows" Then - */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYCOMPUTERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYUSERTYPE = "Windows" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYUSERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - _ - Get - Return m_UserObjectProvider.GetInstance() - End Get - End Property - Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYFORMS = True Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" - - _ - Friend ReadOnly Property Forms() As MyForms - _ - Get - Return m_MyFormsObjectProvider.GetInstance() - End Get - End Property - - _ - _ - Friend NotInheritable Class MyForms - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T - If Instance Is Nothing OrElse Instance.IsDisposed Then - If m_FormBeingCreated IsNot Nothing Then - If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) - End If - Else - m_FormBeingCreated = New Global.System.Collections.Hashtable() - End If - m_FormBeingCreated.Add(GetType(T), Nothing) - Try - Return New T() - Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing - Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) - Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) - Finally - m_FormBeingCreated.Remove(GetType(T)) - End Try - Else - Return Instance - End If - End Function - - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) - instance.Dispose() - instance = Nothing - End Sub - - _ - _ - Public Sub New() - MyBase.New() - End Sub - - Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable - - Public Overrides Function Equals(ByVal o As Object) As Boolean - Return MyBase.Equals(o) - End Function - Public Overrides Function GetHashCode() As Integer - Return MyBase.GetHashCode - End Function - _ - Friend Overloads Function [GetType]() As Global.System.Type - Return GetType(MyForms) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - - Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYWEBSERVICES = True Then - */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default(T); - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - _ - Get - Return m_LogObjectProvider.GetInstance() - End Get - End Property - - Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYTYPE="Web" - */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - [DebuggerHidden()] - get - { - var Value = m_Context.Value; - if (Value is null) - { - Value = new T(); - m_Context.Value = Value; - } - return Value; - } - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Get - If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T - Return m_ThreadStaticValue - End Get - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue(); - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared m_ThreadStaticValue As T - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs deleted file mode 100644 index 01e38502..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.2.Designer.cs +++ /dev/null @@ -1,242 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.Xml.Linq; -using Microsoft.VisualBasic; -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -// See Compiler::LoadXmlSolutionExtension -namespace VisualBasicUsesCSharpRefReturn.My -{ - [Embedded()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal sealed class InternalXmlHelper - { - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private InternalXmlHelper() - { - } - public static string get_Value(IEnumerable source) - { - foreach (XElement item in source) - return item.Value; - return null; - } - - public static void set_Value(IEnumerable source, string value) - { - foreach (XElement item in source) - { - item.Value = value; - break; - } - } - public static string get_AttributeValue(IEnumerable source, XName name) - { - foreach (XElement item in source) - return (string)item.Attribute(name); - return null; - } - - public static void set_AttributeValue(IEnumerable source, XName name, string value) - { - foreach (XElement item in source) - { - item.SetAttributeValue(name, value); - break; - } - } - public static string get_AttributeValue(XElement source, XName name) - { - return (string)source.Attribute(name); - } - - public static void set_AttributeValue(XElement source, XName name, string value) - { - source.SetAttributeValue(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateAttribute(XName name, object value) - { - if (value is null) - { - return null; - } - return new XAttribute(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) - { - var a = new XAttribute(name, ns.NamespaceName); - a.AddAnnotation(ns); - return a; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) - { - if (obj is not null) - { - XElement elem = obj as XElement; - if (elem is not null) - { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); - } - else - { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) - { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); - } - } - } - return obj; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) - { - if (obj is not null) - { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) - { - return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); - } - else - { - return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); - } - } - return obj; - } - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private sealed class RemoveNamespaceAttributesClosure - { - private readonly string[] m_inScopePrefixes; - private readonly XNamespace[] m_inScopeNs; - private readonly List m_attributes; - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) - { - m_inScopePrefixes = inScopePrefixes; - m_inScopeNs = inScopeNs; - m_attributes = attributes; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal XElement ProcessXElement(XElement elem) - { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal object ProcessObject(object obj) - { - XElement elem = obj as XElement; - if (elem is not null) - { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); - } - else - { - return obj; - } - } - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) - { - if (e is not null) - { - var a = e.FirstAttribute; - - while (a is not null) - { - var nextA = a.NextAttribute; - - if (a.IsNamespaceDeclaration) - { - var ns = a.Annotation(); - string prefix = a.Name.LocalName; - - if (ns is not null) - { - if (inScopePrefixes is not null && inScopeNs is not null) - { - int lastIndex = inScopePrefixes.Length - 1; - - for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) - { - string currentInScopePrefix = inScopePrefixes[i]; - var currentInScopeNs = inScopeNs[i]; - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - - if (a is not null) - { - // Prefix is not in scope - // Now check whether it's going to be in scope because it is in the attributes list - - if (attributes is not null) - { - int lastIndex = attributes.Count - 1; - for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) - { - var currentA = attributes[i]; - string currentInScopePrefix = currentA.Name.LocalName; - var currentInScopeNs = currentA.Annotation(); - if (currentInScopeNs is not null) - { - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - } - - if (a is not null) - { - // Prefix is definitely not in scope - a.Remove(); - // namespace is not defined either. Add this attributes list - attributes.Add(a); - } - } - } - } - - a = nextA; - } - } - return e; - } - - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs deleted file mode 100644 index e39b4204..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/MyNamespace.Static.3.Designer.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.VisualBasic -{ - [Embedded()] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.CompilerServices.CompilerGenerated()] - internal sealed class Embedded : Attribute - { - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs deleted file mode 100644 index 4023833b..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/My Project/Settings.Designer.cs +++ /dev/null @@ -1,88 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; -using Microsoft.VisualBasic; - - -namespace VisualBasicUsesCSharpRefReturn.My -{ - - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase - { - - private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); - - #region My.Settings Auto-Save Functionality - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - #endregion - - public static MySettings Default - { - get - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - return defaultInstance; - } - } - } -} - -namespace VisualBasicUsesCSharpRefReturn.My -{ - - [HideModuleName()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - internal static class MySettingsProperty - { - - [System.ComponentModel.Design.HelpKeyword("My.Settings")] - internal static MySettings Settings - { - get - { - return MySettings.Default; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs deleted file mode 100644 index 480dcb9a..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; -using Microsoft.VisualBasic; - - -namespace VisualBasicUsesCSharpRefReturn.My.Resources -{ - - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - [System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [HideModuleName()] - internal static class Resources - { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager - { - get - { - if (ReferenceEquals(resourceMan, null)) - { - var temp = new System.Resources.ResourceManager("VisualBasicUsesCSharpRefReturn.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx deleted file mode 100644 index af7dbebb..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj deleted file mode 100644 index 8b2a8df2..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/VisualBasicUsingCSharpRefReturn.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Debug - AnyCPU - {D0421946-845F-09E8-2545-DE3EB2218254} - Library - VisualBasicUsesCSharpRefReturn - VisualBasicUsesCSharpRefReturn - 512 - Windows - v4.8 - true - $(DefaultItemExcludes);$(ProjectDir)**\*.vb - latest - - - true - full - bin\Debug\ - bin\Debug\VisualBasicUsesCSharpRefReturn.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - pdbonly - true - bin\Release\ - bin\Release\VisualBasicUsesCSharpRefReturn.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - VisualBasicUsesCSharpRefReturn.My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - VisualBasicUsesCSharpRefReturn.My - Settings.Designer.cs - - - - - {8b843547-f49d-40a2-8c4e-1b81d8c5d589} - CSharpRefReturn - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs deleted file mode 100644 index 64b3cd19..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertVbUsingCSharpRefReturnOnly/VisualBasicUsesCSharpRefReturn/WithRefReturnStructure.cs +++ /dev/null @@ -1,41 +0,0 @@ - -namespace VisualBasicUsesCSharpRefReturn -{ - public class WithRefReturnStructure - { - public void UseArr() - { - var arr = default(SomeStruct[]); - var s = default(string); - - { - ref var withBlock = ref arr[0]; - withBlock.P = s; - s = withBlock.P; - } - } - - public void UseRefReturn() - { - var lst = default(CSharpRefReturn.RefReturnList); - var s = default(string); - - { - ref var withBlock = ref lst[0]; - withBlock.P = s; - s = withBlock.P; - } - - { - ref var withBlock1 = ref lst.RefProperty; - withBlock1.P = s; - s = withBlock1.P; - } - } - - public struct SomeStruct - { - public string P { get; set; } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln index 364b3665..cd9da7bc 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/CharacterizationTestSolution.sln @@ -1,10 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34321.82 +# Visual Studio Version 18 +VisualStudioVersion = 18.0.11205.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsAppVb", "WindowsAppVb\WindowsAppVb.csproj", "{63AE39F6-D4CF-0888-2B6F-3EF803778218}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpConsoleApp", "ConsoleApp2\CSharpConsoleApp.csproj", "{B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCore", "NetCore\NetCore.csproj", "{73BF583C-DD55-486C-9D0F-15D3D8CC72D9}" @@ -24,7 +22,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpNetStandardLib", "CSh EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prefix.VbLibrary", "Prefix.VbLibrary\Prefix.VbLibrary.csproj", "{7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.csproj", "{74B9A6AA-3316-0C3A-3957-518673283B21}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsAppVb", "WinFormsAppVb\WinFormsAppVb.csproj", "{8B61DE53-8DCF-03CB-3928-841A18C4BF1E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualBasicConsoleApp", "VisualBasicConsoleApp\VisualBasicConsoleApp.csproj", "{705CCDE1-E790-0587-3FB4-662796892C34}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -32,10 +32,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218}.Release|Any CPU.Build.0 = Release|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7602E54-8F45-4DC4-88B5-E11CDC7E8B41}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -64,10 +60,14 @@ Global {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA}.Release|Any CPU.Build.0 = Release|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74B9A6AA-3316-0C3A-3957-518673283B21}.Release|Any CPU.Build.0 = Release|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B61DE53-8DCF-03CB-3928-841A18C4BF1E}.Release|Any CPU.Build.0 = Release|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {705CCDE1-E790-0587-3FB4-662796892C34}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs deleted file mode 100644 index 3d3b640f..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Application.Designer.cs +++ /dev/null @@ -1,11 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - - diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs deleted file mode 100644 index 896d5d01..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("ConsoleApp1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ConsoleApp1")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3130b95d-a38c-416f-a353-cd75539cbe19")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs deleted file mode 100644 index d2885eb0..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.1.Designer.cs +++ /dev/null @@ -1,470 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using Microsoft.VisualBasic; - -/* TODO ERROR: Skipped IfDirectiveTrivia -#If TARGET = "module" AndAlso _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia -#Const _MYTYPE="Empty" -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE = "WindowsForms" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "WindowsForms" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Windows" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Console" Then -*/ -/* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYWEBSERVICES = True -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYUSERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYCOMPUTERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYAPPLICATIONTYPE = "Console" -*/ -/* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Web" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = False -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WebControl" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Custom" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE <> "Empty" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYTYPE = "Empty" - -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE <> "Empty" Then -*/ -namespace ConsoleApp1.My -{ - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - #If TARGET = "winexe" Then - _ - Friend Shared Sub Main(ByVal Args As String()) - Try - Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) - Finally - End Try - My.Application.Run(Args) - End Sub - #End If - - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Windows" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Console" Then - */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase - { - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYAPPLICATIONTYPE = "WindowsForms" - */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE = "Windows" Then - */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYCOMPUTERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYUSERTYPE = "Windows" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYUSERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - _ - Get - Return m_UserObjectProvider.GetInstance() - End Get - End Property - Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYFORMS = True Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" - - _ - Friend ReadOnly Property Forms() As MyForms - _ - Get - Return m_MyFormsObjectProvider.GetInstance() - End Get - End Property - - _ - _ - Friend NotInheritable Class MyForms - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T - If Instance Is Nothing OrElse Instance.IsDisposed Then - If m_FormBeingCreated IsNot Nothing Then - If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) - End If - Else - m_FormBeingCreated = New Global.System.Collections.Hashtable() - End If - m_FormBeingCreated.Add(GetType(T), Nothing) - Try - Return New T() - Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing - Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) - Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) - Finally - m_FormBeingCreated.Remove(GetType(T)) - End Try - Else - Return Instance - End If - End Function - - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) - instance.Dispose() - instance = Nothing - End Sub - - _ - _ - Public Sub New() - MyBase.New() - End Sub - - Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable - - Public Overrides Function Equals(ByVal o As Object) As Boolean - Return MyBase.Equals(o) - End Function - Public Overrides Function GetHashCode() As Integer - Return MyBase.GetHashCode - End Function - _ - Friend Overloads Function [GetType]() As Global.System.Type - Return GetType(MyForms) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - - Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYWEBSERVICES = True Then - */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default(T); - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - _ - Get - Return m_LogObjectProvider.GetInstance() - End Get - End Property - - Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYTYPE="Web" - */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Get - Dim Value As T = m_Context.Value - If Value Is Nothing Then - Value = New T - m_Context.Value() = Value - End If - Return Value - End Get - *//* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - */ - [DebuggerHidden()] - get - { - if (m_ThreadStaticValue is null) - m_ThreadStaticValue = new T(); - return m_ThreadStaticValue; - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Private ReadOnly m_Context As New Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue(Of T) - *//* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - */ - [System.Runtime.CompilerServices.CompilerGenerated()] - [ThreadStatic()] - private static T m_ThreadStaticValue; - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs deleted file mode 100644 index 7946e911..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/Settings.Designer.cs +++ /dev/null @@ -1,88 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - -using System.Diagnostics; -using Microsoft.VisualBasic; - - -namespace ConsoleApp1.My -{ - - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase - { - - private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); - - #region My.Settings Auto-Save Functionality - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - #endregion - - public static MySettings Default - { - get - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MyType = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - return defaultInstance; - } - } - } -} - -namespace ConsoleApp1.My -{ - - [HideModuleName()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - internal static class MySettingsProperty - { - - [System.ComponentModel.Design.HelpKeyword("My.Settings")] - internal static MySettings Settings - { - get - { - return MySettings.Default; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs deleted file mode 100644 index 2dea3301..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -// ------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -// ------------------------------------------------------------------------------ - - -using System.Diagnostics; -using Microsoft.VisualBasic; - -namespace ConsoleApp1.My.Resources -{ - - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - [System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [HideModuleName()] - internal static class Resources - { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Resources.ResourceManager ResourceManager - { - get - { - if (ReferenceEquals(resourceMan, null)) - { - var temp = new System.Resources.ResourceManager("ConsoleApp1.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal static System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx deleted file mode 100644 index 98745a7c..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj deleted file mode 100644 index c86d66bd..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/VisualBasicConsoleApp.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Debug - AnyCPU - {74B9A6AA-3316-0C3A-3957-518673283B21} - Exe - ConsoleApp1.Module1 - ConsoleApp1 - ConsoleApp1 - 512 - Console - v4.8 - true - - $(DefaultItemExcludes);$(ProjectDir)**\*.vb - latest - - - AnyCPU - true - full - bin\Debug\ - bin\Debug\ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - AnyCPU - pdbonly - true - bin\Release\ - bin\Release\ConsoleApp1.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - ResXFileCodeGenerator - Resources.Designer.cs - ConsoleApp1.My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - ConsoleApp1.My - Settings.Designer.cs - - - - - - {b7602e54-8f45-4dc4-88b5-e11cdc7e8b41} - CSharpConsoleApp - - - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj index 740d7e20..33ac7385 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/ConsoleApp4.csproj @@ -2,7 +2,7 @@ Exe ConsoleApp4 - netcoreapp3.1 + net10.0 $(DefaultItemExcludes);$(ProjectDir)**\*.vb latest diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs deleted file mode 100644 index c43c4ca7..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("Prefix.VbLibrary")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("HP Inc.")] -[assembly: AssemblyProduct("Prefix.VbLibrary")] -[assembly: AssemblyCopyright("Copyright © HP Inc. 2021")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f8a13756-bf39-4447-8ef0-2dae0c851386")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs index 1e1f3f00..75d58675 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.1.Designer.cs @@ -3,466 +3,14 @@ // See the LICENSE file in the project root for more information. using System; -using System.Diagnostics; -using Microsoft.VisualBasic; -/* TODO ERROR: Skipped IfDirectiveTrivia -#If TARGET = "module" AndAlso _MYTYPE = "" Then -*//* TODO ERROR: Skipped DisabledTextTrivia -#Const _MYTYPE="Empty" -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE = "WindowsForms" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "WindowsForms" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = True -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then -*/ -/* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYWEBSERVICES = True -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYUSERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYCOMPUTERTYPE = "Windows" -*//* TODO ERROR: Skipped DefineDirectiveTrivia -#Const _MYAPPLICATIONTYPE = "Windows" -*/ -/* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Console" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Windows" -#Const _MYCOMPUTERTYPE = "Windows" -#Const _MYAPPLICATIONTYPE = "Console" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Web" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = False -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "WebControl" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYFORMS = False -#Const _MYWEBSERVICES = True -#Const _MYUSERTYPE = "Web" -#Const _MYCOMPUTERTYPE = "Web" - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE = "Custom" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -*//* TODO ERROR: Skipped ElifDirectiveTrivia -#ElseIf _MYTYPE <> "Empty" Then -*//* TODO ERROR: Skipped DisabledTextTrivia - -#Const _MYTYPE = "Empty" - -*//* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ -/* TODO ERROR: Skipped IfDirectiveTrivia -#If _MYTYPE <> "Empty" Then -*/ -namespace Prefix.VbLibrary.My +namespace Microsoft.VisualBasic { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "WindowsForms" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase - #If TARGET = "winexe" Then - _ - Friend Shared Sub Main(ByVal Args As String()) - Try - Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) - Finally - End Try - My.Application.Run(Args) - End Sub - #End If - - *//* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Windows" Then - */ - internal partial class MyApplication : Microsoft.VisualBasic.ApplicationServices.ApplicationBase - { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYAPPLICATIONTYPE = "Console" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYAPPLICATIONTYPE = "WindowsForms" - */ - } - - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] + [Embedded()] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE = "Windows" Then - */ - internal partial class MyComputer : Microsoft.VisualBasic.Devices.Computer + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class Embedded : Attribute { - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYCOMPUTERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyComputer() : base() - { - } - } - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - [HideModuleName()] - [System.CodeDom.Compiler.GeneratedCode("MyTemplate", "11.0.0.0")] - internal static class MyProject - { - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYCOMPUTERTYPE <> "" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Computer")] - internal static MyComputer Computer - { - [DebuggerHidden()] - get - { - return m_ComputerObjectProvider.GetInstance; - } - } - - private readonly static ThreadSafeObjectProvider m_ComputerObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.Application")] - internal static MyApplication Application - { - [DebuggerHidden()] - get - { - return m_AppObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_AppObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYUSERTYPE = "Windows" Then - */ - [System.ComponentModel.Design.HelpKeyword("My.User")] - internal static Microsoft.VisualBasic.ApplicationServices.User User - { - [DebuggerHidden()] - get - { - return m_UserObjectProvider.GetInstance; - } - } - private readonly static ThreadSafeObjectProvider m_UserObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped ElifDirectiveTrivia - #ElseIf _MYUSERTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser - _ - Get - Return m_UserObjectProvider.GetInstance() - End Get - End Property - Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYFORMS = True Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - #Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" - - _ - Friend ReadOnly Property Forms() As MyForms - _ - Get - Return m_MyFormsObjectProvider.GetInstance() - End Get - End Property - - _ - _ - Friend NotInheritable Class MyForms - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T - If Instance Is Nothing OrElse Instance.IsDisposed Then - If m_FormBeingCreated IsNot Nothing Then - If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) - End If - Else - m_FormBeingCreated = New Global.System.Collections.Hashtable() - End If - m_FormBeingCreated.Add(GetType(T), Nothing) - Try - Return New T() - Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing - Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) - Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) - Finally - m_FormBeingCreated.Remove(GetType(T)) - End Try - Else - Return Instance - End If - End Function - - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) - instance.Dispose() - instance = Nothing - End Sub - - _ - _ - Public Sub New() - MyBase.New() - End Sub - - Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable - - Public Overrides Function Equals(ByVal o As Object) As Boolean - Return MyBase.Equals(o) - End Function - Public Overrides Function GetHashCode() As Integer - Return MyBase.GetHashCode - End Function - _ - Friend Overloads Function [GetType]() As Global.System.Type - Return GetType(MyForms) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - - Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYWEBSERVICES = True Then - */ - [System.ComponentModel.Design.HelpKeyword("My.WebServices")] - internal static MyWebServices WebServices - { - [DebuggerHidden()] - get - { - return m_MyWebServicesObjectProvider.GetInstance; - } - } - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")] - internal sealed class MyWebServices - { - - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override bool Equals(object o) - { - return base.Equals(o); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override int GetHashCode() - { - return base.GetHashCode(); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - internal new Type GetType() - { - return typeof(MyWebServices); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [DebuggerHidden()] - public override string ToString() - { - return base.ToString(); - } - - [DebuggerHidden()] - private static T Create__Instance__(T instance) where T : new() - { - if (instance is null) - { - return new T(); - } - else - { - return instance; - } - } - - [DebuggerHidden()] - private void Dispose__Instance__(ref T instance) - { - instance = default(T); - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public MyWebServices() : base() - { - } - } - - private readonly static ThreadSafeObjectProvider m_MyWebServicesObjectProvider = new ThreadSafeObjectProvider(); - /* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - /* TODO ERROR: Skipped IfDirectiveTrivia - #If _MYTYPE = "Web" Then - *//* TODO ERROR: Skipped DisabledTextTrivia - - _ - Friend ReadOnly Property Request() As Global.System.Web.HttpRequest - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Request - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Response() As Global.System.Web.HttpResponse - _ - Get - Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current - If CurrentContext IsNot Nothing Then - Return CurrentContext.Response - End If - Return Nothing - End Get - End Property - - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog - _ - Get - Return m_LogObjectProvider.GetInstance() - End Get - End Property - - Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) - - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If '_MYTYPE="Web" - */ - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.InteropServices.ComVisible(false)] - internal sealed class ThreadSafeObjectProvider where T : new() - { - internal T GetInstance - { - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - [DebuggerHidden()] - get - { - var Value = m_Context.Value; - if (Value is null) - { - Value = new T(); - m_Context.Value = Value; - } - return Value; - } - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - _ - Get - If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T - Return m_ThreadStaticValue - End Get - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } - - [DebuggerHidden()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public ThreadSafeObjectProvider() : base() - { - } - - /* TODO ERROR: Skipped IfDirectiveTrivia - #If TARGET = "library" Then - */ - private readonly Microsoft.VisualBasic.MyServices.Internal.ContextValue m_Context = new Microsoft.VisualBasic.MyServices.Internal.ContextValue(); - /* TODO ERROR: Skipped ElseDirectiveTrivia - #Else - *//* TODO ERROR: Skipped DisabledTextTrivia - Private Shared m_ThreadStaticValue As T - *//* TODO ERROR: Skipped EndIfDirectiveTrivia - #End If - */ - } } -} -/* TODO ERROR: Skipped EndIfDirectiveTrivia -#End If -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs index 1eafdfc6..7ff83277 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.2.Designer.cs @@ -1,239 +1,1855 @@ -using System.Collections; -using System.Collections.Generic; -using System.Data; -using System.Diagnostics; -using System.Linq; -using System.Xml.Linq; -using Microsoft.VisualBasic; // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// See Compiler::LoadXmlSolutionExtension -namespace Prefix.VbLibrary.My +using System; +using System.Diagnostics; +using Microsoft.VisualBasic.CompilerServices; + +namespace Microsoft.VisualBasic { - [Embedded()] - [DebuggerNonUserCode()] - [System.Runtime.CompilerServices.CompilerGenerated()] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal sealed class InternalXmlHelper + namespace CompilerServices { + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private InternalXmlHelper() - { - } - public static string get_Value(IEnumerable source) + internal sealed class EmbeddedOperators { - foreach (XElement item in source) - return item.Value; - return null; + private EmbeddedOperators() + { + } + public static int CompareString(string Left, string Right, bool TextCompare) + { + if (ReferenceEquals(Left, Right)) + { + return 0; + } + if (Left is null) + { + if (Right.Length == 0) + { + return 0; + } + return -1; + } + if (Right is null) + { + if (Left.Length == 0) + { + return 0; + } + return 1; + } + int Result; + if (TextCompare) + { + var OptionCompareTextFlags = System.Globalization.CompareOptions.IgnoreCase | System.Globalization.CompareOptions.IgnoreWidth | System.Globalization.CompareOptions.IgnoreKanaType; + Result = Conversions.GetCultureInfo().CompareInfo.Compare(Left, Right, OptionCompareTextFlags); + } + else + { + Result = string.CompareOrdinal(Left, Right); + } + if (Result == 0) + { + return 0; + } + else if (Result > 0) + { + return 1; + } + else + { + return -1; + } + } } - public static void set_Value(IEnumerable source, string value) + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class Conversions { - foreach (XElement item in source) + private Conversions() + { + } + private static object GetEnumValue(object Value) + { + var underlyingType = Enum.GetUnderlyingType(Value.GetType()); + if (underlyingType.Equals(typeof(sbyte))) + { + return (sbyte)Value; + } + else if (underlyingType.Equals(typeof(byte))) + { + return (byte)Value; + } + else if (underlyingType.Equals(typeof(short))) + { + return (short)Value; + } + else if (underlyingType.Equals(typeof(ushort))) + { + return (ushort)Value; + } + else if (underlyingType.Equals(typeof(int))) + { + return (int)Value; + } + else if (underlyingType.Equals(typeof(uint))) + { + return (uint)Value; + } + else if (underlyingType.Equals(typeof(long))) + { + return (long)Value; + } + else if (underlyingType.Equals(typeof(ulong))) + { + return (ulong)Value; + } + else + { + throw new InvalidCastException(); + } + } + public static bool ToBoolean(string Value) + { + if (Value is null) + { + Value = ""; + } + try + { + var loc = GetCultureInfo(); + if (loc.CompareInfo.Compare(Value, bool.FalseString, System.Globalization.CompareOptions.IgnoreCase) == 0) + { + return false; + } + else if (loc.CompareInfo.Compare(Value, bool.TrueString, System.Globalization.CompareOptions.IgnoreCase) == 0) + { + return true; + } + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return ToBoolean(i64Value); + } + return ToBoolean(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static bool ToBoolean(object Value) + { + if (Value is null) + { + return false; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return (bool)Value; + } + else if (Value is sbyte) + { + return ToBoolean((sbyte)Value); + } + else if (Value is byte) + { + return ToBoolean((byte)Value); + } + else if (Value is short) + { + return ToBoolean((short)Value); + } + else if (Value is ushort) + { + return ToBoolean((ushort)Value); + } + else if (Value is int) + { + return ToBoolean((int)Value); + } + else if (Value is uint) + { + return ToBoolean((uint)Value); + } + else if (Value is long) + { + return ToBoolean((long)Value); + } + else if (Value is ulong) + { + return ToBoolean((ulong)Value); + } + else if (Value is decimal) + { + return ToBoolean((decimal)Value); + } + else if (Value is float) + { + return ToBoolean((float)Value); + } + else if (Value is double) + { + return ToBoolean((double)Value); + } + else if (Value is string) + { + return ToBoolean((string)Value); + } + throw new InvalidCastException(); + } + public static byte ToByte(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (byte)i64Value; + } + return (byte)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static byte ToByte(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToByte((bool)Value); + } + else if (Value is sbyte) + { + return (byte)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (byte)(short)Value; + } + else if (Value is ushort) + { + return (byte)(ushort)Value; + } + else if (Value is int) + { + return (byte)(int)Value; + } + else if (Value is uint) + { + return (byte)(uint)Value; + } + else if (Value is long) + { + return (byte)(long)Value; + } + else if (Value is ulong) + { + return (byte)(ulong)Value; + } + else if (Value is decimal) + { + return (byte)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (byte)Math.Round((float)Value); + } + else if (Value is double) + { + return (byte)Math.Round((double)Value); + } + else if (Value is string) + { + return ToByte((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static sbyte ToSByte(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (sbyte)i64Value; + } + return (sbyte)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static sbyte ToSByte(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToSByte((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (sbyte)(byte)Value; + } + else if (Value is short) + { + return (sbyte)(short)Value; + } + else if (Value is ushort) + { + return (sbyte)(ushort)Value; + } + else if (Value is int) + { + return (sbyte)(int)Value; + } + else if (Value is uint) + { + return (sbyte)(uint)Value; + } + else if (Value is long) + { + return (sbyte)(long)Value; + } + else if (Value is ulong) + { + return (sbyte)(ulong)Value; + } + else if (Value is decimal) + { + return (sbyte)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (sbyte)Math.Round((float)Value); + } + else if (Value is double) + { + return (sbyte)Math.Round((double)Value); + } + else if (Value is string) + { + return ToSByte((string)Value); + } + throw new InvalidCastException(); + } + public static short ToShort(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (short)i64Value; + } + return (short)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static short ToShort(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToShort((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (short)(ushort)Value; + } + else if (Value is int) + { + return (short)(int)Value; + } + else if (Value is uint) + { + return (short)(uint)Value; + } + else if (Value is long) + { + return (short)(long)Value; + } + else if (Value is ulong) + { + return (short)(ulong)Value; + } + else if (Value is decimal) + { + return (short)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (short)Math.Round((float)Value); + } + else if (Value is double) + { + return (short)Math.Round((double)Value); + } + else if (Value is string) + { + return ToShort((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static ushort ToUShort(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (ushort)i64Value; + } + return (ushort)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static ushort ToUShort(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToUShort((bool)Value); + } + else if (Value is sbyte) + { + return (ushort)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (ushort)(short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (ushort)(int)Value; + } + else if (Value is uint) + { + return (ushort)(uint)Value; + } + else if (Value is long) + { + return (ushort)(long)Value; + } + else if (Value is ulong) + { + return (ushort)(ulong)Value; + } + else if (Value is decimal) + { + return (ushort)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (ushort)Math.Round((float)Value); + } + else if (Value is double) + { + return (ushort)Math.Round((double)Value); + } + else if (Value is string) + { + return ToUShort((string)Value); + } + throw new InvalidCastException(); + } + public static int ToInteger(string Value) + { + if (Value is null) + { + return 0; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (int)i64Value; + } + return (int)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static int ToInteger(object Value) + { + if (Value is null) + { + return 0; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToInteger((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (int)(uint)Value; + } + else if (Value is long) + { + return (int)(long)Value; + } + else if (Value is ulong) + { + return (int)(ulong)Value; + } + else if (Value is decimal) + { + return (int)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (int)Math.Round((float)Value); + } + else if (Value is double) + { + return (int)Math.Round((double)Value); + } + else if (Value is string) + { + return ToInteger((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static uint ToUInteger(string Value) + { + if (Value is null) + { + return 0U; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return (uint)i64Value; + } + return (uint)Math.Round(ParseDouble(Value)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static uint ToUInteger(object Value) + { + if (Value is null) + { + return 0U; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToUInteger((bool)Value); + } + else if (Value is sbyte) + { + return (uint)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (uint)(short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (uint)(int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (uint)(long)Value; + } + else if (Value is ulong) + { + return (uint)(ulong)Value; + } + else if (Value is decimal) + { + return (uint)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (uint)Math.Round((float)Value); + } + else if (Value is double) + { + return (uint)Math.Round((double)Value); + } + else if (Value is string) + { + return ToUInteger((string)Value); + } + throw new InvalidCastException(); + } + public static long ToLong(string Value) + { + if (Value is null) + { + return 0L; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + return (long)Math.Round(ParseDecimal(Value, null)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static long ToLong(object Value) + { + if (Value is null) + { + return 0L; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToLong((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (long)(ulong)Value; + } + else if (Value is decimal) + { + return (long)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (long)Math.Round((float)Value); + } + else if (Value is double) + { + return (long)Math.Round((double)Value); + } + else if (Value is string) + { + return ToLong((string)Value); + } + throw new InvalidCastException(); + } + [CLSCompliant(false)] + public static ulong ToULong(string Value) + { + if (Value is null) + { + return 0UL; + } + try + { + var ui64Value = default(ulong); + if (IsHexOrOctValue(Value, ref ui64Value)) + { + return ui64Value; + } + return (ulong)Math.Round(ParseDecimal(Value, null)); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + [CLSCompliant(false)] + public static ulong ToULong(object Value) + { + if (Value is null) + { + return 0UL; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToULong((bool)Value); + } + else if (Value is sbyte) + { + return (ulong)(sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (ulong)(short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (ulong)(int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (ulong)(long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (ulong)Math.Round((decimal)Value); + } + else if (Value is float) + { + return (ulong)Math.Round((float)Value); + } + else if (Value is double) + { + return (ulong)Math.Round((double)Value); + } + else if (Value is string) + { + return ToULong((string)Value); + } + throw new InvalidCastException(); + } + public static decimal ToDecimal(bool Value) + { + if (Value) + { + return -1m; + } + else + { + return 0m; + } + } + public static decimal ToDecimal(string Value) + { + if (Value is null) + { + return 0m; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + return ParseDecimal(Value, null); + } + catch (OverflowException e1) + { + throw e1; + } + catch (FormatException e2) + { + throw new InvalidCastException(e2.Message, e2); + } + } + public static decimal ToDecimal(object Value) + { + if (Value is null) + { + return 0m; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToDecimal((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (decimal)Value; + } + else if (Value is float) + { + return (decimal)(float)Value; + } + else if (Value is double) + { + return (decimal)(double)Value; + } + else if (Value is string) + { + return ToDecimal((string)Value); + } + throw new InvalidCastException(); + } + private static decimal ParseDecimal(string Value, System.Globalization.NumberFormatInfo NumberFormat) + { + System.Globalization.NumberFormatInfo NormalizedNumberFormat; + var culture = GetCultureInfo(); + if (NumberFormat is null) + { + NumberFormat = culture.NumberFormat; + } + NormalizedNumberFormat = GetNormalizedNumberFormat(NumberFormat); + const System.Globalization.NumberStyles flags = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingSign | System.Globalization.NumberStyles.AllowParentheses | System.Globalization.NumberStyles.AllowTrailingWhite | System.Globalization.NumberStyles.AllowCurrencySymbol; + Value = ToHalfwidthNumbers(Value, culture); + try + { + return decimal.Parse(Value, flags, NormalizedNumberFormat); + } + catch (FormatException FormatEx) when (!ReferenceEquals(NumberFormat, NormalizedNumberFormat)) + { + return decimal.Parse(Value, flags, NumberFormat); + } + catch (Exception Ex) + { + throw Ex; + } + } + private static System.Globalization.NumberFormatInfo GetNormalizedNumberFormat(System.Globalization.NumberFormatInfo InNumberFormat) + { + System.Globalization.NumberFormatInfo OutNumberFormat; + if (InNumberFormat.CurrencyDecimalSeparator is not null && InNumberFormat.NumberDecimalSeparator is not null && InNumberFormat.CurrencyGroupSeparator is not null && InNumberFormat.NumberGroupSeparator is not null && InNumberFormat.CurrencyDecimalSeparator.Length == 1 && InNumberFormat.NumberDecimalSeparator.Length == 1 && InNumberFormat.CurrencyGroupSeparator.Length == 1 && InNumberFormat.NumberGroupSeparator.Length == 1 && InNumberFormat.CurrencyDecimalSeparator[0] == InNumberFormat.NumberDecimalSeparator[0] && InNumberFormat.CurrencyGroupSeparator[0] == InNumberFormat.NumberGroupSeparator[0] && InNumberFormat.CurrencyDecimalDigits == InNumberFormat.NumberDecimalDigits) + { + return InNumberFormat; + } + if (InNumberFormat.CurrencyDecimalSeparator is not null && InNumberFormat.NumberDecimalSeparator is not null && InNumberFormat.CurrencyDecimalSeparator.Length == InNumberFormat.NumberDecimalSeparator.Length && InNumberFormat.CurrencyGroupSeparator is not null && InNumberFormat.NumberGroupSeparator is not null && InNumberFormat.CurrencyGroupSeparator.Length == InNumberFormat.NumberGroupSeparator.Length) + { + int i; + var loopTo = InNumberFormat.CurrencyDecimalSeparator.Length - 1; + for (i = 0; i <= loopTo; i++) + { + if (InNumberFormat.CurrencyDecimalSeparator[i] != InNumberFormat.NumberDecimalSeparator[i]) + goto MisMatch; + } + var loopTo1 = InNumberFormat.CurrencyGroupSeparator.Length - 1; + for (i = 0; i <= loopTo1; i++) + { + if (InNumberFormat.CurrencyGroupSeparator[i] != InNumberFormat.NumberGroupSeparator[i]) + goto MisMatch; + } + return InNumberFormat; + } + + MisMatch: + ; + + OutNumberFormat = (System.Globalization.NumberFormatInfo)InNumberFormat.Clone(); + OutNumberFormat.CurrencyDecimalSeparator = OutNumberFormat.NumberDecimalSeparator; + OutNumberFormat.CurrencyGroupSeparator = OutNumberFormat.NumberGroupSeparator; + OutNumberFormat.CurrencyDecimalDigits = OutNumberFormat.NumberDecimalDigits; + return OutNumberFormat; + } + public static float ToSingle(string Value) + { + if (Value is null) + { + return 0f; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + double Result = ParseDouble(Value); + if ((Result < float.MinValue || Result > float.MaxValue) && !double.IsInfinity(Result)) + { + throw new OverflowException(); + } + return (float)Result; + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static float ToSingle(object Value) + { + if (Value is null) + { + return 0f; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToSingle((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (float)(decimal)Value; + } + else if (Value is float) + { + return (float)Value; + } + else if (Value is double) + { + return (float)(double)Value; + } + else if (Value is string) + { + return ToSingle((string)Value); + } + throw new InvalidCastException(); + } + public static double ToDouble(string Value) + { + if (Value is null) + { + return 0d; + } + try + { + var i64Value = default(long); + if (IsHexOrOctValue(Value, ref i64Value)) + { + return i64Value; + } + return ParseDouble(Value); + } + catch (FormatException e) + { + throw new InvalidCastException(e.Message, e); + } + } + public static double ToDouble(object Value) + { + if (Value is null) + { + return 0d; + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToDouble((bool)Value); + } + else if (Value is sbyte) + { + return (sbyte)Value; + } + else if (Value is byte) + { + return (byte)Value; + } + else if (Value is short) + { + return (short)Value; + } + else if (Value is ushort) + { + return (ushort)Value; + } + else if (Value is int) + { + return (int)Value; + } + else if (Value is uint) + { + return (uint)Value; + } + else if (Value is long) + { + return (long)Value; + } + else if (Value is ulong) + { + return (ulong)Value; + } + else if (Value is decimal) + { + return (double)(decimal)Value; + } + else if (Value is float) + { + return (double)(float)Value; + } + else if (Value is double) + { + return (double)Value; + } + else if (Value is string) + { + return ToDouble((string)Value); + } + throw new InvalidCastException(); + } + private static double ParseDouble(string Value) + { + System.Globalization.NumberFormatInfo NormalizedNumberFormat; + var culture = GetCultureInfo(); + var NumberFormat = culture.NumberFormat; + NormalizedNumberFormat = GetNormalizedNumberFormat(NumberFormat); + const System.Globalization.NumberStyles flags = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingSign | System.Globalization.NumberStyles.AllowParentheses | System.Globalization.NumberStyles.AllowTrailingWhite | System.Globalization.NumberStyles.AllowCurrencySymbol; + Value = ToHalfwidthNumbers(Value, culture); + try + { + return double.Parse(Value, flags, NormalizedNumberFormat); + } + catch (FormatException FormatEx) when (!ReferenceEquals(NumberFormat, NormalizedNumberFormat)) + { + return double.Parse(Value, flags, NumberFormat); + } + catch (Exception Ex) + { + throw Ex; + } + } + public static DateTime ToDate(string Value) + { + DateTime ParsedDate; + const System.Globalization.DateTimeStyles ParseStyle = System.Globalization.DateTimeStyles.AllowWhiteSpaces | System.Globalization.DateTimeStyles.NoCurrentDateDefault; + var Culture = GetCultureInfo(); + bool result = DateTime.TryParse(ToHalfwidthNumbers(Value, Culture), Culture, ParseStyle, out ParsedDate); + if (result) + { + return ParsedDate; + } + else + { + throw new InvalidCastException(); + } + } + public static DateTime ToDate(object Value) + { + if (Value is null) + { + return default(DateTime); + } + if (Value is DateTime) + { + return ToDate((DateTime)Value); + } + else if (Value is string) + { + return ToDate((string)Value); + } + throw new InvalidCastException(); + } + public static char ToChar(string Value) + { + if (Value is null || Value.Length == 0) + { + return Convert.ToChar(0 & 0xFFFF); + } + return Value[0]; + } + public static char ToChar(object Value) + { + if (Value is null) + { + return Convert.ToChar(0 & 0xFFFF); + } + if (Value is char) + { + return (char)Value; + } + else if (Value is string) + { + return ToChar((string)Value); + } + throw new InvalidCastException(); + } + public static char[] ToCharArrayRankOne(string Value) + { + if (Value is null) + { + Value = ""; + } + return Value.ToCharArray(); + } + public static char[] ToCharArrayRankOne(object Value) + { + if (Value is null) + { + return "".ToCharArray(); + } + char[] ArrayValue = Value as char[]; + if (ArrayValue is not null && ArrayValue.Rank == 1) + { + return ArrayValue; + } + else if (Value is string) + { + return ((string)Value).ToCharArray(); + } + throw new InvalidCastException(); + } + public static new string ToString(short Value) { - item.Value = value; - break; + return Value.ToString(); } - } - public static string get_AttributeValue(IEnumerable source, XName name) - { - foreach (XElement item in source) - return (string)item.Attribute(name); - return null; - } - public static void set_AttributeValue(IEnumerable source, XName name, string value) - { - foreach (XElement item in source) + public static new string ToString(int Value) { - item.SetAttributeValue(name, value); - break; + return Value.ToString(); } - } - public static string get_AttributeValue(XElement source, XName name) - { - return (string)source.Attribute(name); - } - public static void set_AttributeValue(XElement source, XName name, string value) - { - source.SetAttributeValue(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateAttribute(XName name, object value) - { - if (value is null) + [CLSCompliant(false)] + public static new string ToString(uint Value) { - return null; + return Value.ToString(); } - return new XAttribute(name, value); - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) - { - var a = new XAttribute(name, ns.NamespaceName); - a.AddAnnotation(ns); - return a; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) - { - if (obj is not null) + public static new string ToString(long Value) + { + return Value.ToString(); + } + [CLSCompliant(false)] + public static new string ToString(ulong Value) + { + return Value.ToString(); + } + public static new string ToString(float Value) + { + return Value.ToString(); + } + public static new string ToString(double Value) + { + return Value.ToString("G"); + } + public static new string ToString(DateTime Value) + { + long TimeTicks = Value.TimeOfDay.Ticks; + if (TimeTicks == Value.Ticks || Value.Year == 1899 && Value.Month == 12 && Value.Day == 30) + { + return Value.ToString("T"); + } + else if (TimeTicks == 0L) + { + return Value.ToString("d"); + } + else + { + return Value.ToString("G"); + } + } + public static new string ToString(decimal Value) + { + return Value.ToString("G"); + } + public static new string ToString(object Value) + { + if (Value is null) + { + return null; + } + else + { + string StringValue = Value as string; + if (StringValue is not null) + { + return StringValue; + } + } + if (Value is Enum) + { + Value = GetEnumValue(Value); + } + if (Value is bool) + { + return ToString((bool)Value); + } + else if (Value is sbyte) + { + return ((sbyte)Value).ToString(); + } + else if (Value is byte) + { + return ((byte)Value).ToString(); + } + else if (Value is short) + { + return ((short)Value).ToString(); + } + else if (Value is ushort) + { + return ((ushort)Value).ToString(); + } + else if (Value is int) + { + return ((int)Value).ToString(); + } + else if (Value is uint) + { + return ((uint)Value).ToString(); + } + else if (Value is long) + { + return ((long)Value).ToString(); + } + else if (Value is ulong) + { + return ((ulong)Value).ToString(); + } + else if (Value is decimal) + { + return ((decimal)Value).ToString(); + } + else if (Value is float) + { + return ((float)Value).ToString(); + } + else if (Value is double) + { + return ((double)Value).ToString(); + } + else if (Value is char) + { + return ToString((char)Value); + } + else if (Value is DateTime) + { + return ToString((DateTime)Value); + } + else + { + char[] CharArray = Value as char[]; + if (CharArray is not null) + { + return new string(CharArray); + } + } + throw new InvalidCastException(); + } + public static new string ToString(bool Value) { - XElement elem = obj as XElement; - if (elem is not null) + if (Value) + { + return bool.TrueString; + } + else + { + return bool.FalseString; + } + } + public static new string ToString(byte Value) + { + return Value.ToString(); + } + public static new string ToString(char Value) + { + return Value.ToString(); + } + internal static System.Globalization.CultureInfo GetCultureInfo() + { + return System.Globalization.CultureInfo.CurrentCulture; + } + internal static string ToHalfwidthNumbers(string s, System.Globalization.CultureInfo culture) + { + return s; + } + internal static bool IsHexOrOctValue(string Value, ref long i64Value) + { + char ch; + int Length; + var FirstNonspace = default(int); + string TmpValue; + Length = Value.Length; + while (FirstNonspace < Length) + { + ch = Value[FirstNonspace]; + if (ch == '&' && FirstNonspace + 2 < Length) + { + goto GetSpecialValue; + } + if (ch != Strings.ChrW(32) && ch != Strings.ChrW(0x3000)) + { + return false; + } + FirstNonspace += 1; + } + return false; + GetSpecialValue: + ; + + ch = char.ToLowerInvariant(Value[FirstNonspace + 1]); + TmpValue = ToHalfwidthNumbers(Value.Substring(FirstNonspace + 2), GetCultureInfo()); + if (ch == 'h') + { + i64Value = Convert.ToInt64(TmpValue, 16); + } + else if (ch == 'o') { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); + i64Value = Convert.ToInt64(TmpValue, 8); } else { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) + throw new FormatException(); + } + return true; + } + internal static bool IsHexOrOctValue(string Value, ref ulong ui64Value) + { + char ch; + int Length; + var FirstNonspace = default(int); + string TmpValue; + Length = Value.Length; + while (FirstNonspace < Length) + { + ch = Value[FirstNonspace]; + if (ch == '&' && FirstNonspace + 2 < Length) { - return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); + goto GetSpecialValue; } + if (ch != Strings.ChrW(32) && ch != Strings.ChrW(0x3000)) + { + return false; + } + FirstNonspace += 1; + } + return false; + GetSpecialValue: + ; + + ch = char.ToLowerInvariant(Value[FirstNonspace + 1]); + TmpValue = ToHalfwidthNumbers(Value.Substring(FirstNonspace + 2), GetCultureInfo()); + if (ch == 'h') + { + ui64Value = Convert.ToUInt64(TmpValue, 16); + } + else if (ch == 'o') + { + ui64Value = Convert.ToUInt64(TmpValue, 8); + } + else + { + throw new FormatException(); } + return true; } - return obj; - } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) - { - if (obj is not null) + public static T ToGenericParameter(object Value) { - IEnumerable elems = obj as IEnumerable; - if (elems is not null) + if (Value is null) + { + return default(T); + } + var reflectedType = typeof(T); + if (Equals(reflectedType, typeof(bool))) + { + return (T)(object)ToBoolean(Value); + } + else if (Equals(reflectedType, typeof(sbyte))) + { + return (T)(object)ToSByte(Value); + } + else if (Equals(reflectedType, typeof(byte))) + { + return (T)(object)ToByte(Value); + } + else if (Equals(reflectedType, typeof(short))) + { + return (T)(object)ToShort(Value); + } + else if (Equals(reflectedType, typeof(ushort))) + { + return (T)(object)ToUShort(Value); + } + else if (Equals(reflectedType, typeof(int))) + { + return (T)(object)ToInteger(Value); + } + else if (Equals(reflectedType, typeof(uint))) + { + return (T)(object)ToUInteger(Value); + } + else if (Equals(reflectedType, typeof(long))) + { + return (T)(object)ToLong(Value); + } + else if (Equals(reflectedType, typeof(ulong))) + { + return (T)(object)ToULong(Value); + } + else if (Equals(reflectedType, typeof(decimal))) + { + return (T)(object)ToDecimal(Value); + } + else if (Equals(reflectedType, typeof(float))) + { + return (T)(object)ToSingle(Value); + } + else if (Equals(reflectedType, typeof(double))) + { + return (T)(object)ToDouble(Value); + } + else if (Equals(reflectedType, typeof(DateTime))) + { + return (T)(object)ToDate(Value); + } + else if (Equals(reflectedType, typeof(char))) + { + return (T)(object)ToChar(Value); + } + else if (Equals(reflectedType, typeof(string))) { - return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); + return (T)(object)ToString(Value); } else { - return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); + return (T)Value; } } - return obj; } + [Embedded()] [DebuggerNonUserCode()] [System.Runtime.CompilerServices.CompilerGenerated()] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - private sealed class RemoveNamespaceAttributesClosure + internal sealed class ProjectData { - private readonly string[] m_inScopePrefixes; - private readonly XNamespace[] m_inScopeNs; - private readonly List m_attributes; - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) + private ProjectData() + { + } + public static void SetProjectError(Exception ex) + { + } + public static void SetProjectError(Exception ex, int lErl) + { + } + public static void ClearProjectError() { - m_inScopePrefixes = inScopePrefixes; - m_inScopeNs = inScopeNs; - m_attributes = attributes; } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal XElement ProcessXElement(XElement elem) + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class Utils + { + private Utils() { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); } - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - internal object ProcessObject(object obj) + public static Array CopyArray(Array arySrc, Array aryDest) { - XElement elem = obj as XElement; - if (elem is not null) + if (arySrc is null) + { + return aryDest; + } + int lLength; + lLength = arySrc.Length; + if (lLength == 0) + { + return aryDest; + } + if (aryDest.Rank != arySrc.Rank) + { + throw new InvalidCastException(); + } + int iDim; + var loopTo = aryDest.Rank - 2; + for (iDim = 0; iDim <= loopTo; iDim++) { - return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + if (aryDest.GetUpperBound(iDim) != arySrc.GetUpperBound(iDim)) + { + throw new ArrayTypeMismatchException(); + } + } + if (lLength > aryDest.Length) + { + lLength = aryDest.Length; + } + if (arySrc.Rank > 1) + { + int LastRank = arySrc.Rank; + int lenSrcLastRank = arySrc.GetLength(LastRank - 1); + int lenDestLastRank = aryDest.GetLength(LastRank - 1); + if (lenDestLastRank == 0) + { + return aryDest; + } + int lenCopy = lenSrcLastRank > lenDestLastRank ? lenDestLastRank : lenSrcLastRank; + int i; + var loopTo1 = arySrc.Length / lenSrcLastRank - 1; + for (i = 0; i <= loopTo1; i++) + Array.Copy(arySrc, i * lenSrcLastRank, aryDest, i * lenDestLastRank, lenCopy); } else { - return obj; + Array.Copy(arySrc, aryDest, lLength); } + return aryDest; } } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) + internal sealed class ObjectFlowControl { - if (e is not null) + internal sealed class ForLoopControl { - var a = e.FirstAttribute; - - while (a is not null) + public static bool ForNextCheckR4(float count, float limit, float StepValue) { - var nextA = a.NextAttribute; - - if (a.IsNamespaceDeclaration) + if (StepValue >= 0f) { - var ns = a.Annotation(); - string prefix = a.Name.LocalName; - - if (ns is not null) - { - if (inScopePrefixes is not null && inScopeNs is not null) - { - int lastIndex = inScopePrefixes.Length - 1; - - for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) - { - string currentInScopePrefix = inScopePrefixes[i]; - var currentInScopeNs = inScopeNs[i]; - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - - if (a is not null) - { - // Prefix is not in scope - // Now check whether it's going to be in scope because it is in the attributes list - - if (attributes is not null) - { - int lastIndex = attributes.Count - 1; - for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) - { - var currentA = attributes[i]; - string currentInScopePrefix = currentA.Name.LocalName; - var currentInScopeNs = currentA.Annotation(); - if (currentInScopeNs is not null) - { - if (prefix.Equals(currentInScopePrefix)) - { - if (ns == currentInScopeNs) - { - // prefix and namespace match. Remove the unneeded ns attribute - a.Remove(); - } - - // prefix is in scope but refers to something else. Leave the ns attribute. - a = null; - break; - } - } - } - } - - if (a is not null) - { - // Prefix is definitely not in scope - a.Remove(); - // namespace is not defined either. Add this attributes list - attributes.Add(a); - } - } - } + return count <= limit; + } + else + { + return count >= limit; + } + } + public static bool ForNextCheckR8(double count, double limit, double StepValue) + { + if (StepValue >= 0d) + { + return count <= limit; + } + else + { + return count >= limit; + } + } + public static bool ForNextCheckDec(decimal count, decimal limit, decimal StepValue) + { + if (StepValue >= 0m) + { + return count <= limit; + } + else + { + return count >= limit; } - - a = nextA; } } - return e; } - + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class StaticLocalInitFlag + { + public short State; + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class IncompleteInitialization : Exception + { + public IncompleteInitialization() : base() + { + } + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class StandardModuleAttribute : Attribute + { + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class DesignerGeneratedAttribute : Attribute + { + } + [Embedded()] + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class OptionCompareAttribute : Attribute + { + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class OptionTextAttribute : Attribute + { + } + } + [Embedded()] + [AttributeUsage(AttributeTargets.Class, Inherited = false)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.CompilerServices.CompilerGenerated()] + internal sealed class HideModuleNameAttribute : Attribute + { + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [StandardModule] + internal static class Strings + { + public static char ChrW(int CharCode) + { + if (CharCode < -32768 || CharCode > 65535) + { + throw new ArgumentException(); + } + return Convert.ToChar(CharCode & 0xFFFF); + } + public static int AscW(string String) + { + if (String is null || String.Length == 0) + { + throw new ArgumentException(); + } + return AscW(String[0]); + } + public static int AscW(char String) + { + return AscW(String); + } + } + [Embedded()] + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [StandardModule] + internal static class Constants + { + public const string vbCrLf = Conversions.ToString(Strings.ChrW(13)) + Strings.ChrW(10); + public const string vbNewLine = Conversions.ToString(Strings.ChrW(13)) + Strings.ChrW(10); + public const string vbCr = "\r"; + public const string vbLf = "\n"; + public const string vbBack = "\b"; + public const string vbFormFeed = "\f"; + public const string vbTab = "\t"; + public const string vbVerticalTab = "\v"; + public const string vbNullChar = "\0"; + public const string vbNullString = null; } } \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs index 75d58675..f1f6ad0b 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/MyNamespace.Static.3.Designer.cs @@ -1,16 +1,238 @@ +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Xml.Linq; +using Microsoft.VisualBasic; // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; - -namespace Microsoft.VisualBasic +// See Compiler::LoadXmlSolutionExtension +namespace Prefix.VbLibrary.My { [Embedded()] - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Module | AttributeTargets.Assembly, Inherited = false)] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + [DebuggerNonUserCode()] [System.Runtime.CompilerServices.CompilerGenerated()] - internal sealed class Embedded : Attribute + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal sealed class InternalXmlHelper { + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + private InternalXmlHelper() + { + } + public static string get_Value(IEnumerable source) + { + foreach (XElement item in source) + return item.Value; + return null; + } + public static void set_Value(IEnumerable source, string value) + { + foreach (XElement item in source) + { + item.Value = value; + break; + } + } + public static string get_AttributeValue(IEnumerable source, XName name) + { + foreach (XElement item in source) + return (string)item.Attribute(name); + return null; + } + public static void set_AttributeValue(IEnumerable source, XName name, string value) + { + foreach (XElement item in source) + { + item.SetAttributeValue(name, value); + break; + } + } + public static string get_AttributeValue(XElement source, XName name) + { + return (string)source.Attribute(name); + } + public static void set_AttributeValue(XElement source, XName name, string value) + { + source.SetAttributeValue(name, value); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XAttribute CreateAttribute(XName name, object value) + { + if (value is null) + { + return null; + } + return new XAttribute(name, value); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XAttribute CreateNamespaceAttribute(XName name, XNamespace ns) + { + var a = new XAttribute(name, ns.NamespaceName); + a.AddAnnotation(ns); + return a; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static object RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, object obj) + { + if (obj is not null) + { + XElement elem = obj as XElement; + if (elem is not null) + { + return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elem); + } + else + { + IEnumerable elems = obj as IEnumerable; + if (elems is not null) + { + return RemoveNamespaceAttributes(inScopePrefixes, inScopeNs, attributes, elems); + } + } + } + return obj; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static IEnumerable RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, IEnumerable obj) + { + if (obj is not null) + { + IEnumerable elems = obj as IEnumerable; + if (elems is not null) + { + return elems.Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessXElement); + } + else + { + return obj.Cast().Select(new RemoveNamespaceAttributesClosure(inScopePrefixes, inScopeNs, attributes).ProcessObject); + } + } + return obj; + } + [DebuggerNonUserCode()] + [System.Runtime.CompilerServices.CompilerGenerated()] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + private sealed class RemoveNamespaceAttributesClosure + { + private readonly string[] m_inScopePrefixes; + private readonly XNamespace[] m_inScopeNs; + private readonly List m_attributes; + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal RemoveNamespaceAttributesClosure(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes) + { + m_inScopePrefixes = inScopePrefixes; + m_inScopeNs = inScopeNs; + m_attributes = attributes; + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal XElement ProcessXElement(XElement elem) + { + return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + internal object ProcessObject(object obj) + { + XElement elem = obj as XElement; + if (elem is not null) + { + return RemoveNamespaceAttributes(m_inScopePrefixes, m_inScopeNs, m_attributes, elem); + } + else + { + return obj; + } + } + } + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static XElement RemoveNamespaceAttributes(string[] inScopePrefixes, XNamespace[] inScopeNs, List attributes, XElement e) + { + if (e is not null) + { + var a = e.FirstAttribute; + + while (a is not null) + { + var nextA = a.NextAttribute; + + if (a.IsNamespaceDeclaration) + { + var ns = a.Annotation(); + string prefix = a.Name.LocalName; + + if (ns is not null) + { + if (inScopePrefixes is not null && inScopeNs is not null) + { + int lastIndex = inScopePrefixes.Length - 1; + + for (int i = 0, loopTo = lastIndex; i <= loopTo; i++) + { + string currentInScopePrefix = inScopePrefixes[i]; + var currentInScopeNs = inScopeNs[i]; + if (prefix.Equals(currentInScopePrefix)) + { + if (ns == currentInScopeNs) + { + // prefix and namespace match. Remove the unneeded ns attribute + a.Remove(); + } + + // prefix is in scope but refers to something else. Leave the ns attribute. + a = null; + break; + } + } + } + + if (a is not null) + { + // Prefix is not in scope + // Now check whether it's going to be in scope because it is in the attributes list + + if (attributes is not null) + { + int lastIndex = attributes.Count - 1; + for (int i = 0, loopTo1 = lastIndex; i <= loopTo1; i++) + { + var currentA = attributes[i]; + string currentInScopePrefix = currentA.Name.LocalName; + var currentInScopeNs = currentA.Annotation(); + if (currentInScopeNs is not null) + { + if (prefix.Equals(currentInScopePrefix)) + { + if (ns == currentInScopeNs) + { + // prefix and namespace match. Remove the unneeded ns attribute + a.Remove(); + } + + // prefix is in scope but refers to something else. Leave the ns attribute. + a = null; + break; + } + } + } + } + + if (a is not null) + { + // Prefix is definitely not in scope + a.Remove(); + // namespace is not defined either. Add this attributes list + attributes.Add(a); + } + } + } + } + + a = nextA; + } + } + return e; + } + } } \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Resources.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Resources.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs index 113c66ed..fb5f4fcd 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/My Project/Settings.Designer.cs @@ -18,11 +18,9 @@ namespace Prefix.VbLibrary.My [System.Runtime.CompilerServices.CompilerGenerated()] [System.CodeDom.Compiler.GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")] [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)] - internal sealed partial class MySettings : System.Configuration.ApplicationSettingsBase + internal sealed partial class MySettings { - private static MySettings defaultInstance = (MySettings)Synchronized(new MySettings()); - #region My.Settings Auto-Save Functionality /* TODO ERROR: Skipped IfDirectiveTrivia #If _MyType = "WindowsForms" Then @@ -61,7 +59,7 @@ End If *//* TODO ERROR: Skipped EndIfDirectiveTrivia #End If */ - return defaultInstance; + return null; } } } diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj index 1b110b34..43df3db8 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Prefix.VbLibrary.csproj @@ -1,115 +1,9 @@ - - - + - Debug - AnyCPU - {7D8F03A6-764F-00F9-1BBA-8A41CF27F0CA} - Library Prefix.VbLibrary - Prefix.VbLibrary - 512 - Windows - v4.8 - true - + netstandard2.1 $(DefaultItemExcludes);$(ProjectDir)**\*.vb latest - - true - full - bin\Debug\ - bin\Debug\Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - pdbonly - true - bin\Release\ - bin\Release\Prefix.VbLibrary.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Prefix.VbLibrary.My.Resources - Designer - - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - Prefix.VbLibrary.My - Settings.Designer.cs - - - + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx deleted file mode 100644 index 13b775f1..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/Prefix.VbLibrary/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/AVbClass.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/AVbClass.cs similarity index 75% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/AVbClass.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/AVbClass.cs index 6d809b5c..11297647 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/AVbClass.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/AVbClass.cs @@ -1,5 +1,5 @@ -namespace ConsoleApp1 +namespace VisualBasicConsoleApp { static class Module1 diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs new file mode 100644 index 00000000..8536d461 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.1.Designer.cs @@ -0,0 +1,385 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + + +/* TODO ERROR: Skipped IfDirectiveTrivia +#If TARGET = "module" AndAlso _MYTYPE = "" Then +*//* TODO ERROR: Skipped DisabledTextTrivia +#Const _MYTYPE="Empty" +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ +/* TODO ERROR: Skipped IfDirectiveTrivia +#If _MYTYPE = "WindowsForms" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = True +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "WindowsForms" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "WindowsFormsWithCustomSubMain" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = True +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Console" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Windows" OrElse _MYTYPE = "" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Windows" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Console" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Windows" +#Const _MYCOMPUTERTYPE = "Windows" +#Const _MYAPPLICATIONTYPE = "Console" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Web" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = False +#Const _MYWEBSERVICES = False +#Const _MYUSERTYPE = "Web" +#Const _MYCOMPUTERTYPE = "Web" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "WebControl" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYFORMS = False +#Const _MYWEBSERVICES = True +#Const _MYUSERTYPE = "Web" +#Const _MYCOMPUTERTYPE = "Web" + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE = "Custom" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +*//* TODO ERROR: Skipped ElifDirectiveTrivia +#ElseIf _MYTYPE <> "Empty" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +#Const _MYTYPE = "Empty" + +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ +/* TODO ERROR: Skipped IfDirectiveTrivia +#If _MYTYPE <> "Empty" Then +*//* TODO ERROR: Skipped DisabledTextTrivia + +Namespace MergedMyNamespace50E26D7D27174AAEABCA70DEBD52E2FA + +#If _MYAPPLICATIONTYPE = "WindowsForms" OrElse _MYAPPLICATIONTYPE = "Windows" OrElse _MYAPPLICATIONTYPE = "Console" Then + + _ + Partial Friend Class MyApplication + +#If _MYAPPLICATIONTYPE = "WindowsForms" Then + Inherits Global.Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase +#If TARGET = "winexe" Then + _ + Friend Shared Sub Main(ByVal Args As String()) + Try + Global.System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(MyApplication.UseCompatibleTextRendering()) + Finally + End Try + My.Application.Run(Args) + End Sub +#End If + +#ElseIf _MYAPPLICATIONTYPE = "Windows" Then + Inherits Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase +#ElseIf _MYAPPLICATIONTYPE = "Console" Then + Inherits Global.Microsoft.VisualBasic.ApplicationServices.ConsoleApplicationBase +#End If '_MYAPPLICATIONTYPE = "WindowsForms" + + End Class + +#End If '#If _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Windows" or _MYAPPLICATIONTYPE = "Console" + +#If _MYCOMPUTERTYPE <> "" Then + + _ + Partial Friend Class MyComputer + +#If _MYCOMPUTERTYPE = "Windows" Then + Inherits Global.Microsoft.VisualBasic.Devices.Computer +#ElseIf _MYCOMPUTERTYPE = "Web" Then + Inherits Global.Microsoft.VisualBasic.Devices.ServerComputer +#End If + _ + _ + Public Sub New() + MyBase.New() + End Sub + End Class +#End If + + _ + _ + Friend Module MyProject + +#If _MYCOMPUTERTYPE <> "" Then + _ + Friend ReadOnly Property Computer() As MyComputer + _ + Get + Return m_ComputerObjectProvider.GetInstance() + End Get + End Property + + Private ReadOnly m_ComputerObjectProvider As New ThreadSafeObjectProvider(Of MyComputer) +#End If + +#If _MYAPPLICATIONTYPE = "Windows" Or _MYAPPLICATIONTYPE = "WindowsForms" Or _MYAPPLICATIONTYPE = "Console" Then + _ + Friend ReadOnly Property Application() As MyApplication + _ + Get + Return m_AppObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_AppObjectProvider As New ThreadSafeObjectProvider(Of MyApplication) +#End If + +#If _MYUSERTYPE = "Windows" Then + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User + _ + Get + Return m_UserObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User) +#ElseIf _MYUSERTYPE = "Web" Then + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser + _ + Get + Return m_UserObjectProvider.GetInstance() + End Get + End Property + Private ReadOnly m_UserObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser) +#End If + +#If _MYFORMS = True Then + +#Const STARTUP_MY_FORM_FACTORY = "My.MyProject.Forms" + + _ + Friend ReadOnly Property Forms() As MyForms + _ + Get + Return m_MyFormsObjectProvider.GetInstance() + End Get + End Property + + _ + _ + Friend NotInheritable Class MyForms + _ + Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Forms.Form})(ByVal Instance As T) As T + If Instance Is Nothing OrElse Instance.IsDisposed Then + If m_FormBeingCreated IsNot Nothing Then + If m_FormBeingCreated.ContainsKey(GetType(T)) = True Then + Throw New Global.System.InvalidOperationException(Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_RecursiveFormCreate")) + End If + Else + m_FormBeingCreated = New Global.System.Collections.Hashtable() + End If + m_FormBeingCreated.Add(GetType(T), Nothing) + Try + Return New T() + Catch ex As Global.System.Reflection.TargetInvocationException When ex.InnerException IsNot Nothing + Dim BetterMessage As String = Global.Microsoft.VisualBasic.CompilerServices.Utils.GetResourceString("WinForms_SeeInnerException", ex.InnerException.Message) + Throw New Global.System.InvalidOperationException(BetterMessage, ex.InnerException) + Finally + m_FormBeingCreated.Remove(GetType(T)) + End Try + Else + Return Instance + End If + End Function + + _ + Private Sub Dispose__Instance__(Of T As Global.System.Windows.Forms.Form)(ByRef instance As T) + instance.Dispose() + instance = Nothing + End Sub + + _ + _ + Public Sub New() + MyBase.New() + End Sub + + Private Shared m_FormBeingCreated As Global.System.Collections.Hashtable + + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyForms) + End Function + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + End Class + + Private m_MyFormsObjectProvider As New ThreadSafeObjectProvider(Of MyForms) + +#End If + +#If _MYWEBSERVICES = True Then + + _ + Friend ReadOnly Property WebServices() As MyWebServices + _ + Get + Return m_MyWebServicesObjectProvider.GetInstance() + End Get + End Property + + _ + _ + Friend NotInheritable Class MyWebServices + + _ + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + _ + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyWebServices) + End Function + _ + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + + _ + Private Shared Function Create__Instance__(Of T As {New})(ByVal instance As T) As T + If instance Is Nothing Then + Return New T() + Else + Return instance + End If + End Function + + _ + Private Sub Dispose__Instance__(Of T)(ByRef instance As T) + instance = Nothing + End Sub + + _ + _ + Public Sub New() + MyBase.New() + End Sub + End Class + + Private ReadOnly m_MyWebServicesObjectProvider As New ThreadSafeObjectProvider(Of MyWebServices) +#End If + +#If _MYTYPE = "Web" Then + + _ + Friend ReadOnly Property Request() As Global.System.Web.HttpRequest + _ + Get + Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current + If CurrentContext IsNot Nothing Then + Return CurrentContext.Request + End If + Return Nothing + End Get + End Property + + _ + Friend ReadOnly Property Response() As Global.System.Web.HttpResponse + _ + Get + Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current + If CurrentContext IsNot Nothing Then + Return CurrentContext.Response + End If + Return Nothing + End Get + End Property + + _ + Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog + _ + Get + Return m_LogObjectProvider.GetInstance() + End Get + End Property + + Private ReadOnly m_LogObjectProvider As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog) + +#End If '_MYTYPE="Web" + + _ + _ + Friend NotInheritable Class ThreadSafeObjectProvider(Of T As New) + Friend ReadOnly Property GetInstance() As T +#If TARGET = "library" Then + _ + Get + Dim Value As T = m_Context.Value + If Value Is Nothing Then + Value = New T + m_Context.Value() = Value + End If + Return Value + End Get +#Else + _ + Get + If m_ThreadStaticValue Is Nothing Then m_ThreadStaticValue = New T + Return m_ThreadStaticValue + End Get +#End If + End Property + + _ + _ + Public Sub New() + MyBase.New() + End Sub + +#If TARGET = "library" Then + Private ReadOnly m_Context As New Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue(Of T) +#Else + Private Shared m_ThreadStaticValue As T +#End If + End Class + End Module +End Namespace +*//* TODO ERROR: Skipped EndIfDirectiveTrivia +#End If +*/ \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.2.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.2.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.2.Designer.cs index 05c0af1b..0bd773a4 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.2.Designer.cs @@ -1,6 +1,5 @@ using System.Collections; using System.Collections.Generic; -using System.Data; using System.Diagnostics; using System.Linq; using System.Xml.Linq; @@ -10,7 +9,7 @@ // See the LICENSE file in the project root for more information. // See Compiler::LoadXmlSolutionExtension -namespace ConsoleApp1.My +namespace VisualBasicConsoleApp.My { [Embedded()] [DebuggerNonUserCode()] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.3.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp1/My Project/MyNamespace.Static.3.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/My Project/MyNamespace.Static.3.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj new file mode 100644 index 00000000..f2f12a92 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VisualBasicConsoleApp/VisualBasicConsoleApp.csproj @@ -0,0 +1,13 @@ + + + Exe + VisualBasicConsoleApp + net10.0 + $(DefaultItemExcludes);$(ProjectDir)**\*.vb + latest + + + + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs new file mode 100644 index 00000000..50ffd805 --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ApplicationEvents.cs @@ -0,0 +1,30 @@ + +namespace WinFormsAppVb.My +{ + // The following events are available for MyApplication: + // Startup: Raised when the application starts, before the startup form is created. + // Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + // UnhandledException: Raised if the application encounters an unhandled exception. + // StartupNextInstance: Raised when launching a single-instance application and the application is already active. + // NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + + // **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. + + // Example: + // Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults + // + // ' Setting the application-wide default Font: + // e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) + // + // ' Setting the HighDpiMode for the Application: + // e.HighDpiMode = HighDpiMode.PerMonitorV2 + // + // ' If a splash dialog is used, this sets the minimum display time: + // e.MinimumSplashScreenDisplayTime = 4000 + // End Sub + + internal partial class MyApplication + { + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.Designer.cs index b90e7372..5e8fc55a 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.Designer.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.Windows.Forms; -namespace WindowsAppVb +namespace WinFormsAppVb { [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] public partial class FolderForm : Form diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.cs index fb92c16e..4589f3e7 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Folder/FolderForm.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/FolderForm.cs @@ -5,7 +5,7 @@ using System.Threading; using VbNetStandardLib.My.Resources; -namespace WindowsAppVb +namespace WinFormsAppVb { public partial class FolderForm diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/Resource2.Designer.cs similarity index 97% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/Resource2.Designer.cs index 9434b0c9..49c0825b 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder/Resource2.Designer.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Drawing; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder @@ -47,7 +47,7 @@ internal static System.Resources.ResourceManager ResourceManager { if (ReferenceEquals(resourceMan, null)) { - var temp = new System.Resources.ResourceManager("WindowsAppVb.Resource2", typeof(Resource2).Assembly); + var temp = new System.Resources.ResourceManager("WinFormsAppVb.Resource2", typeof(Resource2).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder2/Resource3.Designer.cs similarity index 97% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder2/Resource3.Designer.cs index a3ae0abd..c6b74f6f 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Folder2/Resource3.Designer.cs @@ -12,7 +12,7 @@ using System.Diagnostics; using System.Drawing; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder @@ -47,7 +47,7 @@ internal static System.Resources.ResourceManager ResourceManager { if (ReferenceEquals(resourceMan, null)) { - var temp = new System.Resources.ResourceManager("WindowsAppVb.Resource3", typeof(Resource3).Assembly); + var temp = new System.Resources.ResourceManager("WinFormsAppVb.Resource3", typeof(Resource3).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs new file mode 100644 index 00000000..a9c25a2b --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.Designer.cs @@ -0,0 +1,44 @@ +using System.Diagnostics; +using System.Drawing; +using System.Windows.Forms; + +namespace WinFormsAppVb +{ + [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] + public partial class Form1 : Form + { + + // Form overrides dispose to clean up the component list. + [DebuggerNonUserCode()] + protected override void Dispose(bool disposing) + { + try + { + if (disposing && components is not null) + { + components.Dispose(); + } + } + finally + { + base.Dispose(disposing); + } + } + + // Required by the Windows Form Designer + private System.ComponentModel.IContainer components; + + // 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. + [DebuggerStepThrough()] + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Text = "Form1"; + } + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs new file mode 100644 index 00000000..d577c9ff --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Form1.cs @@ -0,0 +1,12 @@ + +namespace WinFormsAppVb +{ + public partial class Form1 + { + public Form1() + { + InitializeComponent(); + } + + } +} \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Application.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Application.Designer.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Application.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Application.Designer.cs index 08d3eb6c..da7fd024 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Application.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Application.Designer.cs @@ -10,7 +10,7 @@ using System.Diagnostics; -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { // NOTE: This file is auto-generated; do not modify it directly. To make changes, diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Dynamic.Designer.cs similarity index 70% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Dynamic.Designer.cs index 112cae88..06b9c7e1 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Dynamic.Designer.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Diagnostics; -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { internal static partial class MyProject { @@ -32,6 +32,29 @@ public FolderForm FolderForm } + [EditorBrowsable(EditorBrowsableState.Never)] + public Form1 m_Form1; + + public Form1 Form1 + { + [DebuggerHidden] + get + { + m_Form1 = Create__Instance__(m_Form1); + return m_Form1; + } + [DebuggerHidden] + set + { + if (ReferenceEquals(value, m_Form1)) + return; + if (value is not null) + throw new ArgumentException("Property can only be set to Nothing"); + Dispose__Instance__(ref m_Form1); + } + } + + [EditorBrowsable(EditorBrowsableState.Never)] public WinformsDesignerTest m_WinformsDesignerTest; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.1.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.1.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.1.Designer.cs index 693910fe..6f8acac3 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.1.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.1.Designer.cs @@ -91,7 +91,7 @@ /* TODO ERROR: Skipped IfDirectiveTrivia #If _MYTYPE <> "Empty" Then */ -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { /* TODO ERROR: Skipped IfDirectiveTrivia diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.2.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.2.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.2.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.2.Designer.cs index b5342896..c72ccfc3 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.2.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.2.Designer.cs @@ -10,7 +10,7 @@ // See the LICENSE file in the project root for more information. // See Compiler::LoadXmlSolutionExtension -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { [Embedded()] [DebuggerNonUserCode()] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.3.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.3.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Static.3.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/MyNamespace.Static.3.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Resources.Designer.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Resources.Designer.cs index 3483637a..bc2676ad 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Resources.Designer.cs @@ -13,7 +13,7 @@ using System.Drawing; using Microsoft.VisualBasic; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Settings.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Settings.Designer.cs similarity index 98% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Settings.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Settings.Designer.cs index 0e656ea3..57b5d276 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/Settings.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/My Project/Settings.Designer.cs @@ -13,7 +13,7 @@ using Microsoft.VisualBasic; -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { [System.Runtime.CompilerServices.CompilerGenerated()] @@ -74,7 +74,7 @@ public static MySettings Default } } -namespace WindowsAppVb.My +namespace WinFormsAppVb.My { [HideModuleName()] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/ReferencingFormThroughStatic.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ReferencingFormThroughStatic.cs similarity index 96% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/ReferencingFormThroughStatic.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ReferencingFormThroughStatic.cs index dd3bd408..28869548 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/ReferencingFormThroughStatic.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/ReferencingFormThroughStatic.cs @@ -1,5 +1,5 @@ -namespace WindowsAppVb +namespace WinFormsAppVb { public static class ReferencingFormThroughStatic { diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.Designer.cs similarity index 97% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.Designer.cs index 02b2f10a..107504b8 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.Designer.cs @@ -13,7 +13,7 @@ using System.Drawing; using System.Runtime.CompilerServices; -namespace WindowsAppVb.My.Resources +namespace WinFormsAppVb.My.Resources { // This class was auto-generated by the StronglyTypedResourceBuilder @@ -48,7 +48,7 @@ public static System.Resources.ResourceManager ResourceManager { if (ReferenceEquals(resourceMan, null)) { - var temp = new System.Resources.ResourceManager("WindowsAppVb.Resource1", typeof(Resource1).Assembly); + var temp = new System.Resources.ResourceManager("WinFormsAppVb.Resource1", typeof(Resource1).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.en-US.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.en-US.Designer.cs similarity index 100% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource1.en-US.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/Resource1.en-US.Designer.cs diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj new file mode 100644 index 00000000..55b177ff --- /dev/null +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinFormsAppVb.csproj @@ -0,0 +1,33 @@ + + + WinExe + net10.0-windows + Sub Main + true + WindowsForms + $(DefaultItemExcludes);$(ProjectDir)**\*.vb + latest + + + + + + + + + + + + + True + True + Application.myapp + + + + + MyApplicationCodeGenerator + Application.Designer.cs + + + \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.Designer.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.Designer.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.Designer.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.Designer.cs index 0320cdd4..15dc2cde 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.Designer.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.Designer.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using System.Windows.Forms; -namespace WindowsAppVb +namespace WinFormsAppVb { [Microsoft.VisualBasic.CompilerServices.DesignerGenerated()] public partial class WinformsDesignerTest : Form diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.cs similarity index 99% rename from Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.cs rename to Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.cs index 67e5bc4c..880ee48a 100644 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WinformsDesignerTest.cs +++ b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WinFormsAppVb/WinformsDesignerTest.cs @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace WindowsAppVb +namespace WinFormsAppVb { public partial class WinformsDesignerTest { diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs deleted file mode 100644 index b1f7767c..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. - -// Review the values of the assembly attributes - -[assembly: AssemblyTitle("WindowsAppVb")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WindowsAppVb")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] - -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("90704646-cc33-4bd5-b762-cf4fff7331da")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// - -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx deleted file mode 100644 index cc8848ab..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource2.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AnotherString - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx deleted file mode 100644 index c9e68dfc..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.en-US.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AStringinUSLocale - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx deleted file mode 100644 index fe8043c2..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resource3.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - AString - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx deleted file mode 100644 index 7a682428..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/Resources.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - test.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder\test2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - Folder2\test3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj b/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj deleted file mode 100644 index 858fea0a..00000000 --- a/Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/WindowsAppVb.csproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Debug - AnyCPU - {63AE39F6-D4CF-0888-2B6F-3EF803778218} - WinExe - WindowsAppVb.My.MyApplication - WindowsAppVb - WindowsAppVb - 512 - WindowsForms - v4.8 - true - - $(DefaultItemExcludes);$(ProjectDir)**\*.vb - latest - - - AnyCPU - true - full - bin\Debug\ - bin\Debug\WindowsAppVb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE;DEBUG - - - AnyCPU - pdbonly - true - bin\Release\ - bin\Release\WindowsAppVb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - TRACE - - - On - - - Binary - - - Off - - - On - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resource3.resx - - - FolderForm.cs - - - Form - - - True - True - Resource2.resx - - - - True - True - Resource1.resx - - - True - True - Resource1.en-US.resx - - - Form - - - WinformsDesignerTest.cs - Form - - - - True - Application.myapp - True - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - WindowsAppVb.My.Resources - ResXFileCodeGenerator - Resource3.Designer.cs - - - FolderForm.cs - - - WindowsAppVb.My.Resources - ResXFileCodeGenerator - Resource2.Designer.cs - - - PublicResXFileCodeGenerator - Resource1.en-US.Designer.cs - WindowsAppVb.My.Resources - - - WindowsAppVb.My.Resources - PublicResXFileCodeGenerator - Resource1.Designer.cs - - - WinformsDesignerTest.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - WindowsAppVb.My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.cs - - - SettingsSingleFileGenerator - WindowsAppVb.My - Settings.Designer.cs - - - - - - - - - - - - - - - {49DF6752-696A-0F7B-1455-E2F06769DFAE} - VbNetStandardLib - - - - \ No newline at end of file From fa6ba19e0cdbf3c837e70176ef21a4ffd7256b8e Mon Sep 17 00:00:00 2001 From: Graham Date: Sat, 15 Nov 2025 22:15:40 +0000 Subject: [PATCH 31/41] Try to add references to useful things --- CodeConverter/Common/DefaultReferences.cs | 13 +++++++++---- CodeConverter/Common/VisualBasicCompiler.cs | 1 + Tests/Tests.csproj | 4 ---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CodeConverter/Common/DefaultReferences.cs b/CodeConverter/Common/DefaultReferences.cs index 78357f4f..24ca5b49 100644 --- a/CodeConverter/Common/DefaultReferences.cs +++ b/CodeConverter/Common/DefaultReferences.cs @@ -14,12 +14,14 @@ namespace ICSharpCode.CodeConverter.Common; public static class DefaultReferences { private static readonly Assembly[] DefaultAssemblies = new []{ - typeof(object), - typeof(IEnumerable), + // ReSharper disable RedundantNameQualifier + typeof(System.Object), + typeof(System.Collections.IEnumerable), typeof(IEnumerable<>), typeof(ErrorEventArgs), typeof(System.Text.Encoding), - typeof(Enumerable), + typeof(System.Linq.Enumerable), + typeof(System.Console), typeof(System.ComponentModel.BrowsableAttribute), typeof(System.Dynamic.DynamicObject), typeof(System.Data.DataRow), @@ -30,7 +32,10 @@ public static class DefaultReferences typeof(System.Xml.Linq.XElement), typeof(System.Linq.Expressions.Expression), typeof(Microsoft.VisualBasic.Constants), - typeof(System.Data.Common.DbCommand) + typeof(System.Data.Common.DbCommand), + typeof(Microsoft.VisualBasic.Devices.Computer), + typeof(System.Windows.Forms.Form) + // ReSharper restore RedundantNameQualifier }.Select(t => t.Assembly).Concat( new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") } ).ToArray(); diff --git a/CodeConverter/Common/VisualBasicCompiler.cs b/CodeConverter/Common/VisualBasicCompiler.cs index 520c1e6b..a1d1e8fe 100644 --- a/CodeConverter/Common/VisualBasicCompiler.cs +++ b/CodeConverter/Common/VisualBasicCompiler.cs @@ -1,4 +1,5 @@ using System.Text; +using Microsoft.CodeAnalysis.Scripting; using Microsoft.CodeAnalysis.VisualBasic; namespace ICSharpCode.CodeConverter.Common; diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 5a679b1c..d892b00b 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -9,7 +9,6 @@ true - @@ -35,7 +34,4 @@ - - - From 657104202599053804b8b458542a1ec0ecab7baf Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 00:32:57 +0000 Subject: [PATCH 32/41] Remove old built in api - I think we always use the azure function now --- CommandLine/CodeConv/CodeConv.csproj | 5 +++++ Directory.Build.props | 2 +- Func/Func.csproj | 14 ++++++++++---- {Web => Func}/WebConverter.cs | 0 Web/Program.cs | 12 +----------- Web/Web.csproj | 8 -------- 6 files changed, 17 insertions(+), 24 deletions(-) rename {Web => Func}/WebConverter.cs (100%) diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index 7c8805d0..23e1c352 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -40,6 +40,11 @@ all runtime; build; native; contentfiles; analyzers + + + + + diff --git a/Directory.Build.props b/Directory.Build.props index 77d09388..524ff3c2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ true $(NoWarn);1998;NU5100 true - $(WarningsNotAsErrors);NU1605;NU1701;NU1901;NU1902;NU1903;NU1904 + $(WarningsNotAsErrors);NU1605;NU1701;NU1901;NU1902;NU1903;NU1904;NU1510;NU1903 4 true 10.0 diff --git a/Func/Func.csproj b/Func/Func.csproj index 18ace947..f092ca92 100644 --- a/Func/Func.csproj +++ b/Func/Func.csproj @@ -7,12 +7,11 @@ disable ICSharpCode.CodeConverter.Func ICSharpCode.CodeConverter.Func - <_FunctionsSkipCleanOutput>true + <_FunctionsSkipCleanOutput>true - @@ -29,15 +28,22 @@ - - + + + + + + + + + diff --git a/Web/WebConverter.cs b/Func/WebConverter.cs similarity index 100% rename from Web/WebConverter.cs rename to Func/WebConverter.cs diff --git a/Web/Program.cs b/Web/Program.cs index 07e1e2b4..367b919a 100644 --- a/Web/Program.cs +++ b/Web/Program.cs @@ -1,6 +1,4 @@ -using ICSharpCode.CodeConverter.Util; -using ICSharpCode.CodeConverter.Web; -using Microsoft.OpenApi.Models; +using Microsoft.OpenApi.Models; var builder = WebApplication.CreateBuilder(args); @@ -34,14 +32,6 @@ app.UseRouting(); app.UseCors(localOrigins); -app.MapPost("/api/convert", async (ConvertRequest todo) => await WebConverter.ConvertAsync(todo)) - .RequireCors(localOrigins) - .Produces(); - -app.MapGet("/api/version", () => CodeConverterVersion.GetVersion()) - .RequireCors(localOrigins) - .Produces(); - app.MapFallbackToFile("index.html"); app.Run(); \ No newline at end of file diff --git a/Web/Web.csproj b/Web/Web.csproj index fd1fa39b..5161f588 100644 --- a/Web/Web.csproj +++ b/Web/Web.csproj @@ -15,10 +15,6 @@ 10.0 - - - - @@ -26,10 +22,6 @@ - - - - From 14d93ebb79e87fa0b6f53c1792b2adbe687b27c8 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 00:36:36 +0000 Subject: [PATCH 33/41] Get references working the same as before in tests at least less important to have winforms in frontend since it only really works with multiple files --- CodeConverter/Common/DefaultReferences.cs | 4 +--- CommandLine/CodeConv/CodeConv.csproj | 7 ------- Tests/TestRunners/ConverterTestBase.cs | 15 ++++++++++----- Tests/Tests.csproj | 14 +++++++++++++- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/CodeConverter/Common/DefaultReferences.cs b/CodeConverter/Common/DefaultReferences.cs index 24ca5b49..cc22f392 100644 --- a/CodeConverter/Common/DefaultReferences.cs +++ b/CodeConverter/Common/DefaultReferences.cs @@ -32,9 +32,7 @@ public static class DefaultReferences typeof(System.Xml.Linq.XElement), typeof(System.Linq.Expressions.Expression), typeof(Microsoft.VisualBasic.Constants), - typeof(System.Data.Common.DbCommand), - typeof(Microsoft.VisualBasic.Devices.Computer), - typeof(System.Windows.Forms.Form) + typeof(System.Data.SqlClient.SqlCommand) // ReSharper restore RedundantNameQualifier }.Select(t => t.Assembly).Concat( new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") } diff --git a/CommandLine/CodeConv/CodeConv.csproj b/CommandLine/CodeConv/CodeConv.csproj index 23e1c352..4199df59 100644 --- a/CommandLine/CodeConv/CodeConv.csproj +++ b/CommandLine/CodeConv/CodeConv.csproj @@ -19,7 +19,6 @@ true enable $(ContinuousIntegrationBuild) - NU1510;NU1903 @@ -40,12 +39,6 @@ all runtime; build; native; contentfiles; analyzers - - - - - - diff --git a/Tests/TestRunners/ConverterTestBase.cs b/Tests/TestRunners/ConverterTestBase.cs index a1ea27b3..e43a70e2 100644 --- a/Tests/TestRunners/ConverterTestBase.cs +++ b/Tests/TestRunners/ConverterTestBase.cs @@ -36,22 +36,27 @@ public ConverterTestBase(string rootNamespace = null) .WithOptionCompareText(false) .WithOptionStrict(OptionStrict.Off) .WithOptionInfer(true); - EmptyNamespaceOptionStrictOff = new TextConversionOptions(DefaultReferences.NetStandard2) { + EmptyNamespaceOptionStrictOff = new TextConversionOptions(References) { RootNamespaceOverride = string.Empty, TargetCompilationOptionsOverride = options, ShowCompilationErrors = true }; - VisualBasic11 = new TextConversionOptions(DefaultReferences.NetStandard2) { + VisualBasic11 = new TextConversionOptions(References) { RootNamespaceOverride = string.Empty, TargetCompilationOptionsOverride = options.WithParseOptions(new VisualBasicParseOptions(LanguageVersion.VisualBasic11)), ShowCompilationErrors = true }; } + private static IReadOnlyCollection References { get; } = DefaultReferences.With( + typeof(System.Windows.Forms.Form).Assembly, + typeof(Microsoft.VisualBasic.Devices.Computer).Assembly + ); + public async Task TestConversionCSharpToVisualBasicAsync(string csharpCode, string expectedVisualBasicCode, bool expectSurroundingMethodBlock = false, bool expectCompilationErrors = false, TextConversionOptions conversionOptions = null, bool hasLineCommentConversionIssue = false) { expectedVisualBasicCode = AddSurroundingMethodBlock(expectedVisualBasicCode, expectSurroundingMethodBlock); - conversionOptions ??= new TextConversionOptions(DefaultReferences.NetStandard2) { ShowCompilationErrors = !expectSurroundingMethodBlock }; + conversionOptions ??= new TextConversionOptions(References) { ShowCompilationErrors = !expectSurroundingMethodBlock }; await AssertConvertedCodeResultEqualsAsync(csharpCode, expectedVisualBasicCode, conversionOptions); if (_testCstoVbCommentsByDefault && !hasLineCommentConversionIssue) { await AssertLineCommentsConvertedInSameOrderAsync(csharpCode, conversionOptions, "//", LineCanHaveCSharpComment); @@ -109,7 +114,7 @@ public async Task TestConversionVisualBasicToCSharpAsync(string visualBasicCode, bool incompatibleWithAutomatedCommentTesting = false) { if (expectSurroundingBlock) expectedCsharpCode = SurroundWithBlock(expectedCsharpCode); - var conversionOptions = new TextConversionOptions(DefaultReferences.NetStandard2) { + var conversionOptions = new TextConversionOptions(References) { RootNamespaceOverride = _rootNamespace, ShowCompilationErrors = !expectSurroundingBlock }; @@ -143,7 +148,7 @@ private static string SurroundWithBlock(string expectedCsharpCode) protected async Task ConvertAsync(string inputCode, TextConversionOptions conversionOptions = default) where TLanguageConversion : ILanguageConversion, new() { - var textConversionOptions = conversionOptions ?? new TextConversionOptions(DefaultReferences.NetStandard2) { RootNamespaceOverride = _rootNamespace, ShowCompilationErrors = true }; + var textConversionOptions = conversionOptions ?? new TextConversionOptions(References) { RootNamespaceOverride = _rootNamespace, ShowCompilationErrors = true }; var conversionResult = await ProjectConversion.ConvertTextAsync(inputCode, textConversionOptions); return (conversionResult.ConvertedCode ?? "") + (conversionResult.GetExceptionsAsString() ?? ""); } diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index d892b00b..e4562cf2 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -1,12 +1,14 @@  - net10.0 + net10.0-windows Library ICSharpCode.CodeConverter.Tests ICSharpCode.CodeConverter.Tests true true true + true + NU1510;NU1903 @@ -21,6 +23,16 @@ all + + + + + + + + + + From 80369d7b1e3354a09024cf236e617bfcde27549a Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 00:46:26 +0000 Subject: [PATCH 34/41] Accept changes which seem fine and likely just caused by evolving libraries --- .../CSharp/ExpressionTests/ExpressionTests.cs | 2 +- .../ExpressionTests/LinqExpressionTests.cs | 6 ++- .../ExpressionTests/XmlExpressionTests.cs | 38 +++++++++---------- Tests/CSharp/MemberTests/MemberTests.cs | 7 ++-- .../ExpressionTests.cs | 3 +- Tests/CSharp/NamespaceLevelTests.cs | 4 +- .../StatementTests/MethodStatementTests.cs | 8 ++-- Tests/CSharp/TriviaTests.cs | 3 +- Tests/VB/MemberTests.cs | 13 +++---- Tests/VB/NamespaceLevelTests.cs | 2 +- Tests/VB/StandaloneStatementTests.cs | 2 +- Tests/VB/StatementTests.cs | 15 ++------ 12 files changed, 46 insertions(+), 57 deletions(-) diff --git a/Tests/CSharp/ExpressionTests/ExpressionTests.cs b/Tests/CSharp/ExpressionTests/ExpressionTests.cs index 1595a234..a287f2c0 100644 --- a/Tests/CSharp/ExpressionTests/ExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/ExpressionTests.cs @@ -319,7 +319,7 @@ public void Rounding() } } 1 target compilation errors: -CS1503: Argument 1: cannot convert from 'object' to 'double'"); +CS1503: Argument 1: cannot convert from 'object' to 'decimal'"); } [Fact] diff --git a/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs b/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs index 8e3153fa..d180480f 100644 --- a/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/LinqExpressionTests.cs @@ -388,7 +388,8 @@ Public Shared Sub X(objs As List(Of Object)) Dim MaxObj As Integer = Aggregate o In objs Into Max(o.GetHashCode()) Dim CountWhereObj As Integer = Aggregate o In objs Where o.GetHashCode() > 3 Into Count() End Sub -End Class", @"using System.Collections.Generic; +End Class", @"using System; +using System.Collections.Generic; using System.Linq; public partial class VisualBasicClass @@ -611,7 +612,8 @@ Sub Foo() Dim xs As New List(Of String) Dim y = From x In xs Group By x.Length, x.Count() Into Group End Sub -End Class", @"using System.Collections.Generic; +End Class", @"using System; +using System.Collections.Generic; using System.Linq; public partial class Class1 diff --git a/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs b/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs index aa064b41..d059ca7c 100644 --- a/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/XmlExpressionTests.cs @@ -116,22 +116,22 @@ private void TestMethod() { var catalog = new XDocument( new XElement(""Catalog"", -new XElement(""Book"", new XAttribute(""id"", ""bk101""), -new XElement(""Author"", ""Garghentini, Davide""), -new XElement(""Title"", ""XML Developer's Guide""), -new XElement(""Price"", ""44.95""), -new XElement(""Description"", @"" + new XElement(""Book"", new XAttribute(""id"", ""bk101""), + new XElement(""Author"", ""Garghentini, Davide""), + new XElement(""Title"", ""XML Developer's Guide""), + new XElement(""Price"", ""44.95""), + new XElement(""Description"", @"" An in-depth look at creating applications with "", new XElement(""technology"", ""XML""), @"". For "", new XElement(""audience"", ""beginners""), @"" or "", new XElement(""audience"", ""advanced""), @"" developers. "") -), -new XElement(""Book"", new XAttribute(""id"", ""bk331""), -new XElement(""Author"", ""Spencer, Phil""), -new XElement(""Title"", ""Developing Applications with Visual Basic .NET""), -new XElement(""Price"", ""45.95""), -new XElement(""Description"", @"" + ), + new XElement(""Book"", new XAttribute(""id"", ""bk331""), + new XElement(""Author"", ""Spencer, Phil""), + new XElement(""Title"", ""Developing Applications with Visual Basic .NET""), + new XElement(""Price"", ""45.95""), + new XElement(""Description"", @"" Get the expert insights, practical code samples, and best practices you need to advance your expertise with "", new XElement(""technology"", @""Visual @@ -140,23 +140,21 @@ and best practices you need based on professional, pragmatic guidance by today's top "", new XElement(""audience"", ""developers""), @"". "") -) + ) ) ); var htmlOutput = new XElement(""html"", - new XElement(""body"", from book in catalog.Elements(""Catalog"").Elements(""Book"") select new XElement(""div"", - new XElement(""h1"", book.Elements(""Title"").Value), - new XElement(""h3"", ""By "" + book.Elements(""Author"").Value), - new XElement(""h3"", ""Price = "" + book.Elements(""Price"").Value), - + new XElement(""h1"", book.Elements(""Title"").Value), + new XElement(""h3"", ""By "" + book.Elements(""Author"").Value), + new XElement(""h3"", ""Price = "" + book.Elements(""Price"").Value), new XElement(""h2"", ""Description""), TransformDescription((string)book.Elements(""Description"").ElementAtOrDefault(0)), new XElement(""hr"") - ) - ) - ); + ) + ) + ); } public string TransformDescription(string s) diff --git a/Tests/CSharp/MemberTests/MemberTests.cs b/Tests/CSharp/MemberTests/MemberTests.cs index c43138a5..4a2618ac 100644 --- a/Tests/CSharp/MemberTests/MemberTests.cs +++ b/Tests/CSharp/MemberTests/MemberTests.cs @@ -786,8 +786,7 @@ public async Task FieldWithInstanceOperationOfDifferingTypeAsync() { await TestConversionVisualBasicToCSharpAsync(@"Public Class DoesNotNeedConstructor Private ReadOnly ClassVariable1 As New ParallelOptions With {.MaxDegreeOfParallelism = 5} -End Class", @"using System.Threading.Tasks; - +End Class", @" public partial class DoesNotNeedConstructor { private readonly ParallelOptions ClassVariable1 = new ParallelOptions() { MaxDegreeOfParallelism = 5 }; @@ -1154,7 +1153,7 @@ await TestConversionVisualBasicToCSharpAsync( @" Private Shared Function OpenProcess(ByVal dwDesiredAccess As AccessMask, ByVal bInheritHandle As Boolean, ByVal dwProcessId As UInteger) As IntPtr End Function", @"[DllImport(""kernel32.dll"", SetLastError = true)] -private static extern IntPtr OpenProcess(AccessMask dwDesiredAccess, bool bInheritHandle, uint dwProcessId); +private static extern nint OpenProcess(AccessMask dwDesiredAccess, bool bInheritHandle, uint dwProcessId); 1 source compilation errors: BC30002: Type 'AccessMask' is not defined. @@ -1529,7 +1528,7 @@ private void OptionalByRefWithDefault([Optional][DefaultParameterValue(""a"")] r BC30455: Argument not specified for parameter 'str2' of 'Private Sub OptionalByRefNoDefault(ByRef str2 As String)'. BC30455: Argument not specified for parameter 'str3' of 'Private Sub OptionalByRefWithDefault(ByRef str3 As String)'. 1 target compilation errors: -CS7036: There is no argument given that corresponds to the required formal parameter 'str1' of 'MissingByRefArgumentWithNoExplicitDefaultValue.ByRefNoDefault(ref string)' +CS7036: There is no argument given that corresponds to the required parameter 'str1' of 'MissingByRefArgumentWithNoExplicitDefaultValue.ByRefNoDefault(ref string)' "); } } \ No newline at end of file diff --git a/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs b/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs index 32b73591..8c387cc8 100644 --- a/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs +++ b/Tests/CSharp/MissingSemanticModelInfo/ExpressionTests.cs @@ -103,7 +103,8 @@ Sub Foo() Next End Sub -End Class", @" +End Class", @"using System.Linq; + public partial class Class1 { public void Foo() diff --git a/Tests/CSharp/NamespaceLevelTests.cs b/Tests/CSharp/NamespaceLevelTests.cs index 6698bfaf..81a8c20b 100644 --- a/Tests/CSharp/NamespaceLevelTests.cs +++ b/Tests/CSharp/NamespaceLevelTests.cs @@ -427,7 +427,7 @@ internal partial class test : IComparable 1 source compilation errors: BC30149: Class 'test' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'. 1 target compilation errors: -CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object)'"); +CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object?)'"); } [Fact] @@ -444,7 +444,7 @@ internal partial class ClassImplementsInterface2 : IComparable 1 source compilation errors: BC30149: Class 'ClassImplementsInterface2' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'. 1 target compilation errors: -CS0535: 'ClassImplementsInterface2' does not implement interface member 'IComparable.CompareTo(object)'"); +CS0535: 'ClassImplementsInterface2' does not implement interface member 'IComparable.CompareTo(object?)'"); } [Fact] diff --git a/Tests/CSharp/StatementTests/MethodStatementTests.cs b/Tests/CSharp/StatementTests/MethodStatementTests.cs index b2f39e43..39bfd1c7 100644 --- a/Tests/CSharp/StatementTests/MethodStatementTests.cs +++ b/Tests/CSharp/StatementTests/MethodStatementTests.cs @@ -291,7 +291,7 @@ internal partial class TestClass private void TestMethod() { string b; - b = new string(""test"".ToCharArray()); + b = new string(""test""); } }"); } @@ -325,7 +325,7 @@ internal partial class TestClass { private void TestMethod() { - string b = new string(""test"".ToCharArray()); + string b = new string(""test""); } }"); } @@ -342,7 +342,7 @@ internal partial class TestClass { private void TestMethod() { - string b = new string(""test"".ToCharArray()); + string b = new string(""test""); } }"); } @@ -608,7 +608,7 @@ public static void Main() { y._x = 1; Console.Write(y._x); - y = (TestWithForEachClass)null; + y = null; } } } diff --git a/Tests/CSharp/TriviaTests.cs b/Tests/CSharp/TriviaTests.cs index 6aa15dfa..72819641 100644 --- a/Tests/CSharp/TriviaTests.cs +++ b/Tests/CSharp/TriviaTests.cs @@ -377,8 +377,7 @@ End Sub Private ReadOnly ClassVariable1 As New ParallelOptions With {.MaxDegreeOfParallelism = x} #End Region End Class -", @"using System.Threading.Tasks; - +", @" public partial class ConversionTest8 { private int x = 5; diff --git a/Tests/VB/MemberTests.cs b/Tests/VB/MemberTests.cs index 6864da4b..0e5ab136 100644 --- a/Tests/VB/MemberTests.cs +++ b/Tests/VB/MemberTests.cs @@ -968,11 +968,10 @@ await TestConversionCSharpToVisualBasicAsync( Private Shared Function OpenProcess(dwDesiredAccess As AccessMask, bInheritHandle As Boolean, dwProcessId As UInteger) As IntPtr End Function -4 source compilation errors: +3 source compilation errors: CS0246: The type or namespace name 'AccessMask' could not be found (are you missing a using directive or an assembly reference?) CS0246: The type or namespace name 'DllImportAttribute' could not be found (are you missing a using directive or an assembly reference?) CS0246: The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) -CS0246: The type or namespace name 'SetLastError' could not be found (are you missing a using directive or an assembly reference?) 1 target compilation errors: BC30002: Type 'AccessMask' is not defined."); } @@ -1308,12 +1307,12 @@ End Class 15 source compilation errors: CS1002: ; expected -CS0535: 'TestClass' does not implement interface member 'IList.Add(object)' -CS0535: 'TestClass' does not implement interface member 'IList.Contains(object)' +CS0535: 'TestClass' does not implement interface member 'IList.Add(object?)' +CS0535: 'TestClass' does not implement interface member 'IList.Contains(object?)' CS0535: 'TestClass' does not implement interface member 'IList.Clear()' -CS0535: 'TestClass' does not implement interface member 'IList.IndexOf(object)' -CS0535: 'TestClass' does not implement interface member 'IList.Insert(int, object)' -CS0535: 'TestClass' does not implement interface member 'IList.Remove(object)' +CS0535: 'TestClass' does not implement interface member 'IList.IndexOf(object?)' +CS0535: 'TestClass' does not implement interface member 'IList.Insert(int, object?)' +CS0535: 'TestClass' does not implement interface member 'IList.Remove(object?)' CS0535: 'TestClass' does not implement interface member 'IList.RemoveAt(int)' CS0535: 'TestClass' does not implement interface member 'IList.IsReadOnly' CS0535: 'TestClass' does not implement interface member 'IList.IsFixedSize' diff --git a/Tests/VB/NamespaceLevelTests.cs b/Tests/VB/NamespaceLevelTests.cs index 3b8c09c2..0ab313e5 100644 --- a/Tests/VB/NamespaceLevelTests.cs +++ b/Tests/VB/NamespaceLevelTests.cs @@ -443,7 +443,7 @@ Implements IComparable End Class 1 source compilation errors: -CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object)' +CS0535: 'test' does not implement interface member 'IComparable.CompareTo(object?)' 1 target compilation errors: BC30149: Class 'test' must implement 'Function CompareTo(obj As Object) As Integer' for interface 'IComparable'."); } diff --git a/Tests/VB/StandaloneStatementTests.cs b/Tests/VB/StandaloneStatementTests.cs index 76064a77..f6141366 100644 --- a/Tests/VB/StandaloneStatementTests.cs +++ b/Tests/VB/StandaloneStatementTests.cs @@ -52,7 +52,7 @@ await TestConversionCSharpToVisualBasicAsync( End Sub 1 source compilation errors: -CS7036: There is no argument given that corresponds to the required formal parameter 'validOn' of 'AttributeUsageAttribute.AttributeUsageAttribute(AttributeTargets)' +CS7036: There is no argument given that corresponds to the required parameter 'validOn' of 'AttributeUsageAttribute.AttributeUsageAttribute(AttributeTargets)' 1 target compilation errors: BC30455: Argument not specified for parameter 'validOn' of 'Public Overloads Sub New(validOn As AttributeTargets)'."); } diff --git a/Tests/VB/StatementTests.cs b/Tests/VB/StatementTests.cs index 98a76bc1..9035531c 100644 --- a/Tests/VB/StatementTests.cs +++ b/Tests/VB/StatementTests.cs @@ -161,10 +161,7 @@ Private Sub TestMethod() Dim b As String b = New String(""test"") End Sub -End Class - -1 source compilation errors: -CS1503: Argument 1: cannot convert from 'string' to 'char*'"); +End Class"); } [Fact] @@ -180,10 +177,7 @@ void TestMethod() Private Sub TestMethod() Dim b As String = New String(""test"") End Sub -End Class - -1 source compilation errors: -CS1503: Argument 1: cannot convert from 'string' to 'char*'"); +End Class"); } [Fact] @@ -199,10 +193,7 @@ void TestMethod() Private Sub TestMethod() Dim b = New String(""test"") End Sub -End Class - -1 source compilation errors: -CS1503: Argument 1: cannot convert from 'string' to 'char*'"); +End Class"); } [Fact] From 47f0b1f4395927b9750786039acd3972b79f7740 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 01:18:14 +0000 Subject: [PATCH 35/41] Make results closer match for existing --- CodeConverter/CSharp/TypeConversionAnalyzer.cs | 2 +- CodeConverter/Common/DefaultReferences.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CodeConverter/CSharp/TypeConversionAnalyzer.cs b/CodeConverter/CSharp/TypeConversionAnalyzer.cs index b43f7296..d1c3d3d2 100644 --- a/CodeConverter/CSharp/TypeConversionAnalyzer.cs +++ b/CodeConverter/CSharp/TypeConversionAnalyzer.cs @@ -378,7 +378,7 @@ private static TypeConversionKind AnalyzeVbConversion(bool alwaysExplicit, IType return TypeConversionKind.EnumConversionThenCast; } if (vbConversion.IsNarrowing) { - return TypeConversionKind.DestructiveCast; + return vbConversion.IsTypeParameter ? TypeConversionKind.Conversion : TypeConversionKind.DestructiveCast; } if (alwaysExplicit) { return TypeConversionKind.NonDestructiveCast; diff --git a/CodeConverter/Common/DefaultReferences.cs b/CodeConverter/Common/DefaultReferences.cs index cc22f392..54ade271 100644 --- a/CodeConverter/Common/DefaultReferences.cs +++ b/CodeConverter/Common/DefaultReferences.cs @@ -4,6 +4,7 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; namespace ICSharpCode.CodeConverter.Common; @@ -17,8 +18,8 @@ public static class DefaultReferences // ReSharper disable RedundantNameQualifier typeof(System.Object), typeof(System.Collections.IEnumerable), - typeof(IEnumerable<>), - typeof(ErrorEventArgs), + typeof(System.Collections.Generic.IEnumerable<>), + typeof(System.IO.ErrorEventArgs), typeof(System.Text.Encoding), typeof(System.Linq.Enumerable), typeof(System.Console), @@ -32,7 +33,8 @@ public static class DefaultReferences typeof(System.Xml.Linq.XElement), typeof(System.Linq.Expressions.Expression), typeof(Microsoft.VisualBasic.Constants), - typeof(System.Data.SqlClient.SqlCommand) + typeof(System.Data.SqlClient.SqlCommand), + typeof(System.Threading.Tasks.ParallelOptions) // ReSharper restore RedundantNameQualifier }.Select(t => t.Assembly).Concat( new[] { Assembly.Load("System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") } From 4a6e2ff00d5e993dbb3e5888c469ad4d103b5abd Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 01:18:48 +0000 Subject: [PATCH 36/41] These don't matter much - it's hard to reference webui nowadays --- Tests/CSharp/CaseSensitivityTests.cs | 13 ++++++++++--- Tests/CSharp/TypeCastTests.cs | 5 ++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Tests/CSharp/CaseSensitivityTests.cs b/Tests/CSharp/CaseSensitivityTests.cs index 38346418..de7502ec 100644 --- a/Tests/CSharp/CaseSensitivityTests.cs +++ b/Tests/CSharp/CaseSensitivityTests.cs @@ -33,9 +33,9 @@ private void btnOK_Click(object sender, EventArgs e) public partial class VBIsCaseInsensitive { - private System.Web.UI.WebControls.Button _btnOk; + private Global.System.Web.UI.WebControls.Button _btnOk; - protected virtual System.Web.UI.WebControls.Button btnOk + protected virtual Global.System.Web.UI.WebControls.Button btnOk { [MethodImpl(MethodImplOptions.Synchronized)] get @@ -58,7 +58,14 @@ protected virtual System.Web.UI.WebControls.Button btnOk } } } -}"); +} +3 source compilation errors: +BC30002: Type 'System.Web.UI.Page' is not defined. +BC30002: Type 'Global.System.Web.UI.WebControls.Button' is not defined. +BC30590: Event 'Click' cannot be found. +2 target compilation errors: +CS0234: The type or namespace name 'UI' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) +CS0246: The type or namespace name 'Global.System.Web.UI.WebControls.Button' could not be found (are you missing a using directive or an assembly reference?)"); } [Fact] diff --git a/Tests/CSharp/TypeCastTests.cs b/Tests/CSharp/TypeCastTests.cs index cace3a47..5665dc7f 100644 --- a/Tests/CSharp/TypeCastTests.cs +++ b/Tests/CSharp/TypeCastTests.cs @@ -1355,7 +1355,7 @@ internal partial class CharTestClass { private string[] QuoteSplit(string text) { - return text.Split('""'); + return text.Split(""\""""); } }"); } @@ -1535,8 +1535,7 @@ End Function Private Shared Function GenericFunctionWithCastThatExistsInCsharp(Of T As {TestGenericCast})() As T Return New TestGenericCast End Function -End Class", @"using Microsoft.VisualBasic.CompilerServices; // Install-Package Microsoft.VisualBasic - +End Class", @" internal partial class TestGenericCast { private static T GenericFunctionWithCTypeCast() From 9c19a67ccdb2458866550bc3f303b97cb8c4c9f4 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 01:50:02 +0000 Subject: [PATCH 37/41] Remove accidental copying of default value for these --- CodeConverter/CSharp/NameExpressionNodeVisitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeConverter/CSharp/NameExpressionNodeVisitor.cs b/CodeConverter/CSharp/NameExpressionNodeVisitor.cs index b32a62cc..82bb50b0 100644 --- a/CodeConverter/CSharp/NameExpressionNodeVisitor.cs +++ b/CodeConverter/CSharp/NameExpressionNodeVisitor.cs @@ -435,7 +435,7 @@ List GetRefParameters(VBSyntax.ArgumentListSyntax argumentList var arg = (ArgumentSyntax)CommonConversions.CsSyntaxGenerator.Argument(p.RefKind, SyntaxFactory.IdentifierName(p.Name)); arguments.Add(arg); var par = (ParameterSyntax)CommonConversions.CsSyntaxGenerator.ParameterDeclaration(p); - parameters.Add(par); + parameters.Add(par.WithDefault(null)); } return (SyntaxFactory.SeparatedList(arguments), SyntaxFactory.SeparatedList(parameters)); } From ebff4679cd1c8236e1c2400d2f5608d9a37659b8 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 02:57:22 +0000 Subject: [PATCH 38/41] Fall back on handling private or unknown cs symbols based on their syntax attributes --- CodeConverter/CSharp/ArgumentConverter.cs | 2 +- CodeConverter/CSharp/CommonConversions.cs | 22 ++++++++++++++++++- .../CSharp/NameExpressionNodeVisitor.cs | 2 +- .../CSharp/SemanticModelExtensions.cs | 15 ------------- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/CodeConverter/CSharp/ArgumentConverter.cs b/CodeConverter/CSharp/ArgumentConverter.cs index ac9e8f0e..675919c3 100644 --- a/CodeConverter/CSharp/ArgumentConverter.cs +++ b/CodeConverter/CSharp/ArgumentConverter.cs @@ -32,7 +32,7 @@ public async Task ConvertSimpleArgumentAsync(VBSyntax.SimpleAr var baseSymbol = symbol?.OriginalDefinition.GetBaseSymbol(); var possibleParameters = (CommonConversions.GetCsOriginalSymbolOrNull(baseSymbol) ?? symbol)?.GetParameters(); if (possibleParameters.HasValue) { - var refType = _semanticModel.GetRefConversionType(node, argList, possibleParameters.Value, out var argName, out var refKind); + var refType = CommonConversions.GetRefConversionType(node, argList, possibleParameters.Value, out var argName, out var refKind); token = CommonConversions.GetRefToken(refKind); if (refType != SemanticModelExtensions.RefConversion.Inline) { convertedArgExpression = HoistByRefDeclaration(node, convertedArgExpression, refType, argName, refKind); diff --git a/CodeConverter/CSharp/CommonConversions.cs b/CodeConverter/CSharp/CommonConversions.cs index 3365628d..f56e3fce 100644 --- a/CodeConverter/CSharp/CommonConversions.cs +++ b/CodeConverter/CSharp/CommonConversions.cs @@ -1,4 +1,5 @@ -using System.Linq.Expressions; +using System.Collections.Immutable; +using System.Linq.Expressions; using System.Runtime.CompilerServices; using ICSharpCode.CodeConverter.Util.FromRoslyn; using Microsoft.CodeAnalysis.Classification; @@ -669,6 +670,7 @@ public ISymbol GetCsOriginalSymbolOrNull(ISymbol symbol) symbol = symbol.OriginalDefinition; // Construct throws an exception if ConstructedFrom differs from it, so let's use ConstructedFrom directly var symbolToFind = symbol is IMethodSymbol m ? m.ConstructedFrom : symbol; + // This no longer works for private members: https://github.com/dotnet/roslyn/issues/72369#issuecomment-1975066163 var similarSymbol = SymbolFinder.FindSimilarSymbols(symbolToFind, _csCompilation).FirstOrDefault(); return similarSymbol; } @@ -747,6 +749,9 @@ public RefKind GetCsRefKind(IParameterSymbol vbParameter, Microsoft.CodeAnalysis return csParam.RefKind; } + var syntaxNodes = vbParameter?.DeclaringSyntaxReferences.Select(r => r.GetSyntax()); + optionalParameterSyntax ??= syntaxNodes?.OfType().FirstOrDefault(); + if (optionalParameterSyntax?.AttributeLists.Any(this.HasOutAttribute) == true) { return RefKind.Out; } @@ -800,4 +805,19 @@ public async Task WithRemovedRedundantConversionOrNullAsync(VB return writtenByUser ? null : this.TypeConversionAnalyzer.AddExplicitConversion(conversionArg, csharpArg, forceTargetType: forceTargetType, defaultToCast: true); } + + public SemanticModelExtensions.RefConversion GetRefConversionType(VBSyntax.ArgumentSyntax node, VBSyntax.ArgumentListSyntax argList, ImmutableArray parameters, out string argName, out RefKind refKind) + { + var parameter = node.IsNamed && node is VBSyntax.SimpleArgumentSyntax sas + ? parameters.FirstOrDefault(p => p.Name.Equals(sas.NameColonEquals.Name.Identifier.Text, StringComparison.OrdinalIgnoreCase)) + : parameters.ElementAtOrDefault(argList.Arguments.IndexOf(node)); + if (parameter != null) { + refKind = GetCsRefKind(parameter); + argName = parameter.Name; + } else { + refKind = RefKind.None; + argName = null; + } + return SemanticModel.NeedsVariableForArgument(node, refKind); + } } \ No newline at end of file diff --git a/CodeConverter/CSharp/NameExpressionNodeVisitor.cs b/CodeConverter/CSharp/NameExpressionNodeVisitor.cs index 82bb50b0..0deb89bf 100644 --- a/CodeConverter/CSharp/NameExpressionNodeVisitor.cs +++ b/CodeConverter/CSharp/NameExpressionNodeVisitor.cs @@ -452,7 +452,7 @@ private bool RequiresLocalFunction(VBSyntax.InvocationExpressionSyntax invocatio bool RequiresLocalFunction(RefConversion possibleInline, VBSyntax.InvocationExpressionSyntax invocation, IMethodSymbol invocationSymbol, VBSyntax.ArgumentSyntax a) { - var refConversion = _semanticModel.GetRefConversionType(a, invocation.ArgumentList, invocationSymbol.Parameters, out string _, out _); + var refConversion = CommonConversions.GetRefConversionType(a, invocation.ArgumentList, invocationSymbol.Parameters, out string _, out _); if (RefConversion.Inline == refConversion || possibleInline == refConversion) return false; if (!(a is VBSyntax.SimpleArgumentSyntax sas)) return false; var argExpression = sas.Expression.SkipIntoParens(); diff --git a/CodeConverter/CSharp/SemanticModelExtensions.cs b/CodeConverter/CSharp/SemanticModelExtensions.cs index b51f8e9f..238b001b 100644 --- a/CodeConverter/CSharp/SemanticModelExtensions.cs +++ b/CodeConverter/CSharp/SemanticModelExtensions.cs @@ -64,21 +64,6 @@ public static TSymbol GetSymbolInfoInDocument(this SemanticModel semant return semanticModel.SyntaxTree == node.SyntaxTree ? semanticModel.GetSymbolInfo(node).ExtractBestMatch() : null; } - public static RefConversion GetRefConversionType(this SemanticModel semanticModel, VBSyntax.ArgumentSyntax node, VBSyntax.ArgumentListSyntax argList, ImmutableArray parameters, out string argName, out RefKind refKind) - { - var parameter = node.IsNamed && node is VBSyntax.SimpleArgumentSyntax sas - ? parameters.FirstOrDefault(p => p.Name.Equals(sas.NameColonEquals.Name.Identifier.Text, StringComparison.OrdinalIgnoreCase)) - : parameters.ElementAtOrDefault(argList.Arguments.IndexOf(node)); - if (parameter != null) { - refKind = parameter.RefKind; - argName = parameter.Name; - } else { - refKind = RefKind.None; - argName = null; - } - return semanticModel.NeedsVariableForArgument(node, refKind); - } - public static RefConversion NeedsVariableForArgument(this SemanticModel semanticModel, VBasic.Syntax.ArgumentSyntax node, RefKind refKind) { if (refKind == RefKind.None) return RefConversion.Inline; From f4b2f845c61dbfadadd43c7e923854e8960bfdfe Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 03:00:42 +0000 Subject: [PATCH 39/41] These changes seem ok --- Tests/CSharp/ExpressionTests/StringExpressionTests.cs | 1 + Tests/CSharp/MemberTests/MemberTests.cs | 3 ++- Tests/CSharp/TriviaTests.cs | 3 ++- Tests/CSharp/TypeCastTests.cs | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Tests/CSharp/ExpressionTests/StringExpressionTests.cs b/Tests/CSharp/ExpressionTests/StringExpressionTests.cs index 73e07b5d..60cd5422 100644 --- a/Tests/CSharp/ExpressionTests/StringExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/StringExpressionTests.cs @@ -504,6 +504,7 @@ Public Sub TestEnumConcat() End Sub End Class", @"using System; +using System.IO; public partial class EnumTests { diff --git a/Tests/CSharp/MemberTests/MemberTests.cs b/Tests/CSharp/MemberTests/MemberTests.cs index 4a2618ac..71d5186f 100644 --- a/Tests/CSharp/MemberTests/MemberTests.cs +++ b/Tests/CSharp/MemberTests/MemberTests.cs @@ -786,7 +786,8 @@ public async Task FieldWithInstanceOperationOfDifferingTypeAsync() { await TestConversionVisualBasicToCSharpAsync(@"Public Class DoesNotNeedConstructor Private ReadOnly ClassVariable1 As New ParallelOptions With {.MaxDegreeOfParallelism = 5} -End Class", @" +End Class", @"using System.Threading.Tasks; + public partial class DoesNotNeedConstructor { private readonly ParallelOptions ClassVariable1 = new ParallelOptions() { MaxDegreeOfParallelism = 5 }; diff --git a/Tests/CSharp/TriviaTests.cs b/Tests/CSharp/TriviaTests.cs index 72819641..6aa15dfa 100644 --- a/Tests/CSharp/TriviaTests.cs +++ b/Tests/CSharp/TriviaTests.cs @@ -377,7 +377,8 @@ End Sub Private ReadOnly ClassVariable1 As New ParallelOptions With {.MaxDegreeOfParallelism = x} #End Region End Class -", @" +", @"using System.Threading.Tasks; + public partial class ConversionTest8 { private int x = 5; diff --git a/Tests/CSharp/TypeCastTests.cs b/Tests/CSharp/TypeCastTests.cs index 5665dc7f..83c59f19 100644 --- a/Tests/CSharp/TypeCastTests.cs +++ b/Tests/CSharp/TypeCastTests.cs @@ -1535,7 +1535,8 @@ End Function Private Shared Function GenericFunctionWithCastThatExistsInCsharp(Of T As {TestGenericCast})() As T Return New TestGenericCast End Function -End Class", @" +End Class", @"using Microsoft.VisualBasic.CompilerServices; // Install-Package Microsoft.VisualBasic + internal partial class TestGenericCast { private static T GenericFunctionWithCTypeCast() @@ -1552,7 +1553,7 @@ private static T GenericFunctionWithCast() } private static T GenericFunctionWithCastThatExistsInCsharp() where T : TestGenericCast { - return (T)new TestGenericCast(); + return Conversions.ToGenericParameter(new TestGenericCast()); } }"); } From 907a497a9194bf20a6c7a83715b2caacb78b1bcf Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 03:34:29 +0000 Subject: [PATCH 40/41] Take a best effort match. ExtractBestMatch is a bit of a misnomer - it enforces having precisely one match --- CodeConverter/CSharp/ArgumentConverter.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CodeConverter/CSharp/ArgumentConverter.cs b/CodeConverter/CSharp/ArgumentConverter.cs index 675919c3..41db921f 100644 --- a/CodeConverter/CSharp/ArgumentConverter.cs +++ b/CodeConverter/CSharp/ArgumentConverter.cs @@ -147,7 +147,10 @@ private CSSyntax.ExpressionSyntax HoistByRefDeclaration(VBSyntax.SimpleArgumentS private ISymbol GetInvocationSymbol(SyntaxNode invocation) { var symbol = invocation.TypeSwitch( - (VBSyntax.InvocationExpressionSyntax e) => _semanticModel.GetSymbolInfo(e).ExtractBestMatch(), + (VBSyntax.InvocationExpressionSyntax e) => _semanticModel.GetSymbolInfo(e).CandidateSymbols + .OrderByDescending(s => s.GetParameters().Length == e.ArgumentList.Arguments.Count) + .ThenByDescending(s => ParameterMatchScore(s, e.ArgumentList.Arguments)) + .FirstOrDefault(), (VBSyntax.ObjectCreationExpressionSyntax e) => _semanticModel.GetSymbolInfo(e).ExtractBestMatch(), (VBSyntax.RaiseEventStatementSyntax e) => _semanticModel.GetSymbolInfo(e.Name).ExtractBestMatch(), (VBSyntax.MidExpressionSyntax _) => CommonConversions.KnownTypes.VbCompilerStringType?.GetMembers("MidStmtStr").FirstOrDefault(), @@ -155,6 +158,12 @@ private ISymbol GetInvocationSymbol(SyntaxNode invocation) return symbol; } + private static int ParameterMatchScore(ISymbol symbol, SeparatedSyntaxList arguments) + { + //TODO: Match on name/position and type + return 1; + } + private IEnumerable GetAdditionalRequiredArgs( IEnumerable arguments, ISymbol invocationSymbol) From d4c6bd834b506b49c71805b3f52e283090509571 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 16 Nov 2025 03:36:18 +0000 Subject: [PATCH 41/41] Remove old net framework version --- .../CodeConv.NetFramework.csproj | 34 ------------------- .../CodeConvProgram.NetFramework.cs | 6 ---- DotNetBuildable.slnf | 1 - .../CSharp/ExpressionTests/ExpressionTests.cs | 6 ++-- 4 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj delete mode 100644 CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs diff --git a/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj b/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj deleted file mode 100644 index 057d5785..00000000 --- a/CommandLine/CodeConv.NetFramework/CodeConv.NetFramework.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - Exe - net472 - ICSharpCode.CodeConverter.CodeConv.NetFramework - ICSharpCode.CodeConverter.CodeConv.NetFramework - codeconv - enable - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs b/CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs deleted file mode 100644 index 29976623..00000000 --- a/CommandLine/CodeConv.NetFramework/CodeConvProgram.NetFramework.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace ICSharpCode.CodeConverter.CommandLine; - -public partial class CodeConvProgram -{ - private static readonly bool _runningInNetCore = false; -} \ No newline at end of file diff --git a/DotNetBuildable.slnf b/DotNetBuildable.slnf index e7b42845..2a8ca97b 100644 --- a/DotNetBuildable.slnf +++ b/DotNetBuildable.slnf @@ -3,7 +3,6 @@ "path": "CodeConverter.sln", "projects": [ "CodeConverter\\CodeConverter.csproj", - "CommandLine\\CodeConv.NetFramework\\CodeConv.NetFramework.csproj", "CommandLine\\CodeConv.Shared\\CodeConv.Shared.shproj", "CommandLine\\CodeConv\\CodeConv.csproj", "Func\\Func.csproj", diff --git a/Tests/CSharp/ExpressionTests/ExpressionTests.cs b/Tests/CSharp/ExpressionTests/ExpressionTests.cs index a287f2c0..ed6513a2 100644 --- a/Tests/CSharp/ExpressionTests/ExpressionTests.cs +++ b/Tests/CSharp/ExpressionTests/ExpressionTests.cs @@ -572,11 +572,13 @@ public partial class VisualBasicClass public VisualBasicClass() { - SomeDateDateNothing = string.IsNullOrEmpty(Conversions.ToString(SomeDate)) ? default : DateTime.Parse(Conversions.ToString(SomeDate)); + SomeDateDateNothing = string.IsNullOrEmpty(Conversions.ToString(SomeDate)) ? (object)null : DateTime.Parse(SomeDate); isNotNothing = SomeDateDateNothing is not null; isSomething = new DateTime() is var arg1 && SomeDateDateNothing.HasValue ? SomeDateDateNothing.Value == arg1 : (bool?)null; } -}"); +} +1 target compilation errors: +CS1503: Argument 1: cannot convert from 'object' to 'string'"); } [Fact]