From 9750fe011ef79cff8362517b3b203cfa26bb5c99 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Tue, 20 Apr 2021 19:35:48 -0500 Subject: [PATCH 01/12] fixes bug surfaced when converting VB win forms projects. System.Windows.Forms import should remain --- .../ProjectItemHelpers.cs | 5 +- .../SmokeTests.WinformsVbFramework/App.config | 6 + .../Form1.Designer.vb | 51 ++++++++ .../SmokeTests.WinformsVbFramework/Form1.resx | 120 +++++++++++++++++ .../SmokeTests.WinformsVbFramework/Form1.vb | 5 + .../My Project/Application.Designer.vb | 38 ++++++ .../My Project/Application.myapp | 11 ++ .../My Project/AssemblyInfo.vb | 35 +++++ .../My Project/Resources.Designer.vb | 62 +++++++++ .../My Project/Resources.resx | 117 +++++++++++++++++ .../My Project/Settings.Designer.vb | 73 +++++++++++ .../My Project/Settings.settings | 7 + .../SmokeTests.WinformsVbFramework.vbproj | 123 ++++++++++++++++++ .../SmokeTests.WinformsVbKeepTfm/App.config | 6 + .../Form1.Designer.vb | 51 ++++++++ .../SmokeTests.WinformsVbKeepTfm/Form1.resx | 120 +++++++++++++++++ .../SmokeTests.WinformsVbKeepTfm/Form1.vb | 5 + .../My Project/Application.Designer.vb | 38 ++++++ .../My Project/Application.myapp | 11 ++ .../My Project/AssemblyInfo.vb | 35 +++++ .../My Project/Resources.Designer.vb | 62 +++++++++ .../My Project/Resources.resx | 117 +++++++++++++++++ .../My Project/Settings.Designer.vb | 73 +++++++++++ .../My Project/Settings.settings | 7 + .../SmokeTests.WinformsVbKeepTfm.vbproj | 52 ++++++++ .../Smoke.Tests/BasicConversions.cs | 16 ++- 26 files changed, 1241 insertions(+), 5 deletions(-) create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/App.config create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings create mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/SmokeTests.WinformsVbFramework.vbproj create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings create mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj diff --git a/src/MSBuild.Abstractions/ProjectItemHelpers.cs b/src/MSBuild.Abstractions/ProjectItemHelpers.cs index c6ddda04c..69a4f96e2 100644 --- a/src/MSBuild.Abstractions/ProjectItemHelpers.cs +++ b/src/MSBuild.Abstractions/ProjectItemHelpers.cs @@ -31,7 +31,10 @@ public static bool IsSpecificPacakgeReference(ProjectItemElement element, string public static bool DesktopReferencesNeedsRemoval(ProjectItemElement item) => DesktopFacts.ReferencesThatNeedRemoval.Contains(item.Include, StringComparer.OrdinalIgnoreCase) || DesktopFacts.KnownWPFReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - || DesktopFacts.KnownWinFormsReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) + || (DesktopFacts.KnownWinFormsReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) + // does not remove DesktopFacts.KnownWinFormsReferences from Visual Basic projects + // note that VB Win Forms projects do not include a project type GUID + && !item.ContainingProject.FullPath.EndsWith(".VBPROJ", StringComparison.OrdinalIgnoreCase)) || DesktopFacts.KnownDesktopReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase); /// diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/App.config b/tests/TestData/SmokeTests.WinformsVbFramework/App.config new file mode 100644 index 000000000..1c7577218 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb new file mode 100644 index 000000000..9c863ff9d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb @@ -0,0 +1,51 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal 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() + Me.Label1 = New System.Windows.Forms.Label() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(142, 95) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(39, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Label1" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.Text = "Form1" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents Label1 As Label +End Class diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/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/SmokeTests.WinformsVbFramework/Form1.vb b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb new file mode 100644 index 000000000..7980bb62d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb @@ -0,0 +1,5 @@ +Public Class Form1 + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Label1.Text = "Hello World" + End Sub +End Class diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb new file mode 100644 index 000000000..9c4a4116d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' 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.WindowsApp1.Form1 + End Sub + End Class +End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp new file mode 100644 index 000000000..1243847fd --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb new file mode 100644 index 000000000..41a5b28b8 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +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/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb new file mode 100644 index 000000000..46a9dd11b --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' 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.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("WindowsApp1.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(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb new file mode 100644 index 000000000..5a65e0e1b --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 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(ByVal sender As Global.System.Object, ByVal 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.WindowsApp1.My.MySettings + Get + Return Global.WindowsApp1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings new file mode 100644 index 000000000..85b890b3c --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/SmokeTests.WinformsVbFramework.vbproj b/tests/TestData/SmokeTests.WinformsVbFramework/SmokeTests.WinformsVbFramework.vbproj new file mode 100644 index 000000000..3b8195e6d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbFramework/SmokeTests.WinformsVbFramework.vbproj @@ -0,0 +1,123 @@ + + + + + Debug + AnyCPU + {3EC71C8F-3F90-4172-81DB-DA8FFB941E8B} + WinExe + WindowsApp1.My.MyApplication + WindowsApp1 + WindowsApp1 + 512 + WindowsForms + v4.8 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\ + WindowsApp1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + WindowsApp1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config b/tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config new file mode 100644 index 000000000..1c7577218 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb new file mode 100644 index 000000000..9c863ff9d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb @@ -0,0 +1,51 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal 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() + Me.Label1 = New System.Windows.Forms.Label() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(142, 95) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(39, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "Label1" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.Text = "Form1" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents Label1 As Label +End Class diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/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/SmokeTests.WinformsVbKeepTfm/Form1.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb new file mode 100644 index 000000000..7980bb62d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb @@ -0,0 +1,5 @@ +Public Class Form1 + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Label1.Text = "Hello World" + End Sub +End Class diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb new file mode 100644 index 000000000..9c4a4116d --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' 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.WindowsApp1.Form1 + End Sub + End Class +End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp new file mode 100644 index 000000000..1243847fd --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb new file mode 100644 index 000000000..41a5b28b8 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +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/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb new file mode 100644 index 000000000..46a9dd11b --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' 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.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("WindowsApp1.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(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb new file mode 100644 index 000000000..5a65e0e1b --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' 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(ByVal sender As Global.System.Object, ByVal 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.WindowsApp1.My.MySettings + Get + Return Global.WindowsApp1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings new file mode 100644 index 000000000..85b890b3c --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj new file mode 100644 index 000000000..10ba64ac5 --- /dev/null +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj @@ -0,0 +1,52 @@ + + + net48 + WinExe + WindowsApp1.My.MyApplication + WindowsApp1 + WindowsApp1 + WindowsForms + false + true + true + + + WindowsApp1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + false + WindowsApp1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + + + + + \ No newline at end of file diff --git a/tests/end-to-end/Smoke.Tests/BasicConversions.cs b/tests/end-to-end/Smoke.Tests/BasicConversions.cs index 306adf763..95fd0b8e4 100644 --- a/tests/end-to-end/Smoke.Tests/BasicConversions.cs +++ b/tests/end-to-end/Smoke.Tests/BasicConversions.cs @@ -68,6 +68,14 @@ public void ConvertsWpfVbFrameworkTemplateForNet50() AssertConversionWorks(projectToConvertPath, projectBaselinePath, "net5.0-windows"); } + [Fact] + public void ConvertsWinformsVbFrameworkTemplateAndKeepTargetFrameworkMoniker() + { + var projectToConvertPath = GetVisualBasicProjectPath("SmokeTests.WinformsVbFramework"); + var projectBaselinePath = GetVisualBasicProjectPath("SmokeTests.WinformsVbKeepTfm"); + AssertConversionWorks(projectToConvertPath, projectBaselinePath, "testdata", keepTargetFramework:true); + } + [Fact] public void ConvertsWinformsFrameworkTemplateForNetCoreApp31() { @@ -116,17 +124,17 @@ public void ConvertsLegacyWebLibraryToNet5() AssertConversionWorks(projectToConvertPath, projectBaselinePath, "net5.0", true); } - private void AssertConversionWorks(string projectToConvertPath, string projectBaselinePath, string targetTFM, bool forceWeb = false) + private void AssertConversionWorks(string projectToConvertPath, string projectBaselinePath, string targetTFM, bool forceWeb = false, bool keepTargetFramework = false) { - var (baselineRootElement, convertedRootElement) = GetRootElementsForComparison(projectToConvertPath, projectBaselinePath, targetTFM, forceWeb); + var (baselineRootElement, convertedRootElement) = GetRootElementsForComparison(projectToConvertPath, projectBaselinePath, targetTFM, forceWeb, keepTargetFramework); AssertPropsEqual(baselineRootElement, convertedRootElement); AssertItemsEqual(baselineRootElement, convertedRootElement); } - private static (IProjectRootElement baselineRootElement, IProjectRootElement convertedRootElement) GetRootElementsForComparison(string projectToConvertPath, string projectBaselinePath, string targetTFM, bool forceWeb) + private static (IProjectRootElement baselineRootElement, IProjectRootElement convertedRootElement) GetRootElementsForComparison(string projectToConvertPath, string projectBaselinePath, string targetTFM, bool forceWeb, bool keepTargetFramework) { var conversionLoader = new MSBuildConversionWorkspaceLoader(projectToConvertPath, MSBuildConversionWorkspaceType.Project); - var conversionWorkspace = conversionLoader.LoadWorkspace(projectToConvertPath, noBackup: true, targetTFM, false, forceWeb); + var conversionWorkspace = conversionLoader.LoadWorkspace(projectToConvertPath, noBackup: true, targetTFM, keepTargetFramework, forceWeb); var baselineLoader = new MSBuildConversionWorkspaceLoader(projectBaselinePath, MSBuildConversionWorkspaceType.Project); var baselineRootElement = baselineLoader.GetRootElementFromProjectFile(projectBaselinePath); From eec45460073da6c3c1390176d032422df4424d8b Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Wed, 21 Apr 2021 19:17:45 -0500 Subject: [PATCH 02/12] keeping all DesktopFacts.ReferencesThatNeedRemoval.Contains(item.Include, StringComparer.OrdinalIgnoreCase) || DesktopFacts.KnownWPFReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - || (DesktopFacts.KnownWinFormsReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - // does not remove DesktopFacts.KnownWinFormsReferences from Visual Basic projects - // note that VB Win Forms projects do not include a project type GUID - && !item.ContainingProject.FullPath.EndsWith(".VBPROJ", StringComparison.OrdinalIgnoreCase)) + || DesktopFacts.KnownWinFormsReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) || DesktopFacts.KnownDesktopReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase); /// diff --git a/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs b/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs index fa9ff28b6..63a07025f 100644 --- a/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs +++ b/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs @@ -204,7 +204,12 @@ public static IProjectRootElement RemoveOrUpdateItems(this IProjectRootElement p } projectRootElement.AddPackage(packageName, version); - itemGroup.RemoveChild(item); + + // remove if this item is not an import element + if (!item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(item.Include)) + { + itemGroup.RemoveChild(item); + } } else if (ProjectItemHelpers.IsReferenceComingFromOldNuGet(item)) { @@ -242,7 +247,9 @@ static void UpdateBasedOnDiff(ImmutableArray itemsDiff, ProjectItemGr if (!itemTypeDiff.DefaultedItems.IsDefault) { var defaultedItems = itemTypeDiff.DefaultedItems.Select(i => i.EvaluatedInclude); - if (defaultedItems.Contains(item.Include, StringComparer.OrdinalIgnoreCase)) + if (defaultedItems.Contains(item.Include, StringComparer.OrdinalIgnoreCase) + // and this item is not an import element + && !item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(item.Include)) { itemGroup.RemoveChild(item); } @@ -263,6 +270,7 @@ static void UpdateBasedOnDiff(ImmutableArray itemsDiff, ProjectItemGr static bool IsDesktopRemovableItem(BaselineProject sdkBaselineProject, ProjectItemGroupElement itemGroup, ProjectItemElement item) { return sdkBaselineProject.ProjectStyle == ProjectStyle.WindowsDesktop + && !IsVbProjImportItem(item) && (ProjectItemHelpers.IsLegacyXamlDesignerItem(item) || ProjectItemHelpers.IsDependentUponXamlDesignerItem(item) || ProjectItemHelpers.IsDesignerFile(item) @@ -271,6 +279,13 @@ static bool IsDesktopRemovableItem(BaselineProject sdkBaselineProject, ProjectIt || ProjectItemHelpers.DesktopReferencesNeedsRemoval(item) || ProjectItemHelpers.IsDesktopRemovableGlobbedItem(sdkBaselineProject.ProjectStyle, item)); } + + static bool IsVbProjImportItem(ProjectItemElement item) + { + return item.ContainingProject.FullPath.EndsWith(".VBPROJ", StringComparison.OrdinalIgnoreCase) + && item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) + && !string.IsNullOrWhiteSpace(item.Include); + } } public static IProjectRootElement AddItemRemovesForIntroducedItems(this IProjectRootElement projectRootElement, ImmutableDictionary differs) From 22144965a9ee456a0c68e365b6962b3e92614198 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Wed, 21 Apr 2021 19:18:02 -0500 Subject: [PATCH 03/12] bug fix - have multiple visual studio installs --- src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs b/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs index 3f128de72..662dd02f3 100644 --- a/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs +++ b/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs @@ -22,7 +22,9 @@ public static string FindHighestInstalledTargetFramework(bool usePreviewSDK) string? sdkPath = null; try { - sdkPath = Path.GetFullPath(Path.Combine(MSBuildLocator.QueryVisualStudioInstances().Single().VisualStudioRootPath, "..", "..")); + var instances = MSBuildLocator.QueryVisualStudioInstances() + .OrderBy(vs => vs.Version); + sdkPath = Path.GetFullPath(Path.Combine(instances.Last().VisualStudioRootPath, "..", "..")); } catch (Exception) { From 4ebf38c3e2e6776c85a01bb8ec95d576395223fc Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Thu, 22 Apr 2021 16:00:12 -0500 Subject: [PATCH 04/12] now passing msbuild path to TargetFrameworkHelper.cs --- src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs | 12 +++++++----- src/try-convert/Program.cs | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs b/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs index 662dd02f3..f36112c2e 100644 --- a/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs +++ b/src/MSBuild.Conversion.SDK/TargetFrameworkHelper.cs @@ -5,7 +5,6 @@ using System.Text.Json; using System.Text.RegularExpressions; -using Microsoft.Build.Locator; using MSBuild.Conversion.Facts; using NuGet.Versioning; @@ -16,15 +15,18 @@ public static class TargetFrameworkHelper /// /// Determine the TFM to use based on what is installed on the users machine /// - public static string FindHighestInstalledTargetFramework(bool usePreviewSDK) + public static string FindHighestInstalledTargetFramework(bool usePreviewSDK, string msbuildPath) { // Finds SDK path string? sdkPath = null; try { - var instances = MSBuildLocator.QueryVisualStudioInstances() - .OrderBy(vs => vs.Version); - sdkPath = Path.GetFullPath(Path.Combine(instances.Last().VisualStudioRootPath, "..", "..")); + if (string.IsNullOrWhiteSpace(msbuildPath)) + { + throw new InvalidOperationException("msbuildPath is rquired"); + } + + sdkPath = Path.GetFullPath(Path.Combine(msbuildPath, "..", "..")); } catch (Exception) { diff --git a/src/try-convert/Program.cs b/src/try-convert/Program.cs index 21ca11cb7..21182a097 100644 --- a/src/try-convert/Program.cs +++ b/src/try-convert/Program.cs @@ -79,7 +79,7 @@ public static int Run(string? project, string? workspace, string? msbuildPath, s } else { - tfm = TargetFrameworkHelper.FindHighestInstalledTargetFramework(preview); + tfm = TargetFrameworkHelper.FindHighestInstalledTargetFramework(preview, msbuildPath); } var workspacePath = string.Empty; From 936bbc92813c834cb72ef9f0946a569cc2861fb7 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Thu, 22 Apr 2021 16:06:29 -0500 Subject: [PATCH 05/12] removing unused files --- .../SmokeTests.WinformsVbFramework/App.config | 6 - .../Form1.Designer.vb | 51 -------- .../SmokeTests.WinformsVbFramework/Form1.resx | 120 ------------------ .../SmokeTests.WinformsVbFramework/Form1.vb | 5 - .../My Project/Application.Designer.vb | 38 ------ .../My Project/Application.myapp | 11 -- .../My Project/AssemblyInfo.vb | 35 ----- .../My Project/Resources.Designer.vb | 62 --------- .../My Project/Resources.resx | 117 ----------------- .../My Project/Settings.Designer.vb | 73 ----------- .../My Project/Settings.settings | 7 - .../SmokeTests.WinformsVbKeepTfm/App.config | 6 - .../Form1.Designer.vb | 51 -------- .../SmokeTests.WinformsVbKeepTfm/Form1.resx | 120 ------------------ .../SmokeTests.WinformsVbKeepTfm/Form1.vb | 5 - .../My Project/Application.Designer.vb | 38 ------ .../My Project/Application.myapp | 11 -- .../My Project/AssemblyInfo.vb | 35 ----- .../My Project/Resources.Designer.vb | 62 --------- .../My Project/Resources.resx | 117 ----------------- .../My Project/Settings.Designer.vb | 73 ----------- .../My Project/Settings.settings | 7 - 22 files changed, 1050 deletions(-) delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/App.config delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/App.config b/tests/TestData/SmokeTests.WinformsVbFramework/App.config deleted file mode 100644 index 1c7577218..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb deleted file mode 100644 index 9c863ff9d..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.Designer.vb +++ /dev/null @@ -1,51 +0,0 @@ - _ -Partial Class Form1 - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal 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() - Me.Label1 = New System.Windows.Forms.Label() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(142, 95) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(39, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Label1" - ' - 'Form1 - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(800, 450) - Me.Controls.Add(Me.Label1) - Me.Name = "Form1" - Me.Text = "Form1" - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - - Friend WithEvents Label1 As Label -End Class diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx deleted file mode 100644 index 1af7de150..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.resx +++ /dev/null @@ -1,120 +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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb b/tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb deleted file mode 100644 index 7980bb62d..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/Form1.vb +++ /dev/null @@ -1,5 +0,0 @@ -Public Class Form1 - Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load - Label1.Text = "Hello World" - End Sub -End Class diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.Designer.vb deleted file mode 100644 index 9c4a4116d..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/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.WindowsApp1.Form1 - End Sub - End Class -End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp deleted file mode 100644 index 1243847fd..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Application.myapp +++ /dev/null @@ -1,11 +0,0 @@ - - - true - Form1 - false - 0 - true - 0 - 0 - true - diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/AssemblyInfo.vb deleted file mode 100644 index 41a5b28b8..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/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/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb deleted file mode 100644 index 46a9dd11b..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +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.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("WindowsApp1.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(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.Designer.vb deleted file mode 100644 index 5a65e0e1b..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/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(ByVal sender As Global.System.Object, ByVal 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.WindowsApp1.My.MySettings - Get - Return Global.WindowsApp1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings b/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings deleted file mode 100644 index 85b890b3c..000000000 --- a/tests/TestData/SmokeTests.WinformsVbFramework/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config b/tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config deleted file mode 100644 index 1c7577218..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb deleted file mode 100644 index 9c863ff9d..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.Designer.vb +++ /dev/null @@ -1,51 +0,0 @@ - _ -Partial Class Form1 - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal 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() - Me.Label1 = New System.Windows.Forms.Label() - Me.SuspendLayout() - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(142, 95) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(39, 13) - Me.Label1.TabIndex = 0 - Me.Label1.Text = "Label1" - ' - 'Form1 - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(800, 450) - Me.Controls.Add(Me.Label1) - Me.Name = "Form1" - Me.Text = "Form1" - Me.ResumeLayout(False) - Me.PerformLayout() - - End Sub - - Friend WithEvents Label1 As Label -End Class diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx deleted file mode 100644 index 1af7de150..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.resx +++ /dev/null @@ -1,120 +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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb deleted file mode 100644 index 7980bb62d..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/Form1.vb +++ /dev/null @@ -1,5 +0,0 @@ -Public Class Form1 - Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load - Label1.Text = "Hello World" - End Sub -End Class diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.Designer.vb deleted file mode 100644 index 9c4a4116d..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/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.WindowsApp1.Form1 - End Sub - End Class -End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp deleted file mode 100644 index 1243847fd..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Application.myapp +++ /dev/null @@ -1,11 +0,0 @@ - - - true - Form1 - false - 0 - true - 0 - 0 - true - diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/AssemblyInfo.vb deleted file mode 100644 index 41a5b28b8..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/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/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb deleted file mode 100644 index 46a9dd11b..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +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.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("WindowsApp1.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(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.Designer.vb deleted file mode 100644 index 5a65e0e1b..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/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(ByVal sender As Global.System.Object, ByVal 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.WindowsApp1.My.MySettings - Get - Return Global.WindowsApp1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings b/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings deleted file mode 100644 index 85b890b3c..000000000 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From 9ae9337612016906e6e74666b48ea6e7c40c599c Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Thu, 22 Apr 2021 16:11:24 -0500 Subject: [PATCH 06/12] fixed test data for vb win forms keep-tfms --- .../SmokeTests.WinformsVbKeepTfm.vbproj | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj index 10ba64ac5..cb10d78a3 100644 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj @@ -20,27 +20,37 @@ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + - + + True Application.myapp - + True True Resources.resx - + True Settings.settings True - + MyApplicationCodeGenerator Application.Designer.vb From 2da3982c32b31ad15b4fec132489232a97c7ae8f Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Thu, 22 Apr 2021 16:13:58 -0500 Subject: [PATCH 07/12] removing test data noise --- .../SmokeTests.WpfVbFramework/App.config | 6 - .../Application.xaml | 9 -- .../Application.xaml.vb | 6 - .../SmokeTests.WpfVbFramework/MainWindow.xaml | 12 -- .../MainWindow.xaml.vb | 3 - .../My Project/AssemblyInfo.vb | 59 --------- .../My Project/MyExtensions/MyWpfExtension.vb | 121 ------------------ .../My Project/Resources.Designer.vb | 62 --------- .../My Project/Resources.resx | 117 ----------------- .../My Project/Settings.Designer.vb | 73 ----------- .../My Project/Settings.settings | 7 - .../SmokeTests.WpfVbNet5Baseline/App.config | 6 - .../Application.xaml | 9 -- .../Application.xaml.vb | 6 - .../MainWindow.xaml | 12 -- .../MainWindow.xaml.vb | 3 - .../My Project/AssemblyInfo.vb | 59 --------- .../My Project/MyExtensions/MyWpfExtension.vb | 121 ------------------ .../My Project/Resources.Designer.vb | 62 --------- .../My Project/Resources.resx | 117 ----------------- .../My Project/Settings.Designer.vb | 73 ----------- .../My Project/Settings.settings | 7 - 22 files changed, 950 deletions(-) delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/App.config delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/Application.xaml delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/Application.xaml.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/My Project/AssemblyInfo.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/My Project/MyExtensions/MyWpfExtension.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.resx delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.settings delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/App.config delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/AssemblyInfo.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/MyExtensions/MyWpfExtension.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.resx delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.Designer.vb delete mode 100644 tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.settings diff --git a/tests/TestData/SmokeTests.WpfVbFramework/App.config b/tests/TestData/SmokeTests.WpfVbFramework/App.config deleted file mode 100644 index 193aecc67..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbFramework/Application.xaml b/tests/TestData/SmokeTests.WpfVbFramework/Application.xaml deleted file mode 100644 index a1e4723d6..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/Application.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/tests/TestData/SmokeTests.WpfVbFramework/Application.xaml.vb b/tests/TestData/SmokeTests.WpfVbFramework/Application.xaml.vb deleted file mode 100644 index 084cbe917..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/Application.xaml.vb +++ /dev/null @@ -1,6 +0,0 @@ -Class Application - - ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException - ' can be handled in this file. - -End Class diff --git a/tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml b/tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml deleted file mode 100644 index 9e5eac609..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml.vb b/tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml.vb deleted file mode 100644 index 922a5dedd..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/MainWindow.xaml.vb +++ /dev/null @@ -1,3 +0,0 @@ -Class MainWindow - -End Class diff --git a/tests/TestData/SmokeTests.WpfVbFramework/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.WpfVbFramework/My Project/AssemblyInfo.vb deleted file mode 100644 index 261ce7b76..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,59 +0,0 @@ -Imports System -Imports System.Globalization -Imports System.Reflection -Imports System.Resources -Imports System.Runtime.InteropServices -Imports System.Windows - -' 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 - - - - - - - - - -'In order to begin building localizable applications, set -'CultureYouAreCodingWith in your .vbproj file -'inside a . For example, if you are using US english -'in your source files, set the to "en-US". Then uncomment the -'NeutralResourceLanguage attribute below. Update the "en-US" in the line -'below to match the UICulture setting in the project file. - -' - - -'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. -'1st parameter: where theme specific resource dictionaries are located -'(used if a resource is not found in the page, -' or application resource dictionaries) - -'2nd parameter: where the generic resource dictionary is located -'(used if a resource is not found in the page, -'app, and any theme specific resource dictionaries) - - - - -'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/SmokeTests.WpfVbFramework/My Project/MyExtensions/MyWpfExtension.vb b/tests/TestData/SmokeTests.WpfVbFramework/My Project/MyExtensions/MyWpfExtension.vb deleted file mode 100644 index 22f84b7da..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/My Project/MyExtensions/MyWpfExtension.vb +++ /dev/null @@ -1,121 +0,0 @@ -#If _MyType <> "Empty" Then - -Namespace My - ''' - ''' Module used to define the properties that are available in the My Namespace for WPF - ''' - ''' - _ - Module MyWpfExtension - Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer) - Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User) - Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows) - Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log) - ''' - ''' Returns the application object for the running application - ''' - _ - Friend ReadOnly Property Application() As Application - Get - Return CType(Global.System.Windows.Application.Current, Application) - End Get - End Property - ''' - ''' Returns information about the host computer. - ''' - _ - Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer - Get - Return s_Computer.GetInstance() - End Get - End Property - ''' - ''' Returns information for the current user. If you wish to run the application with the current - ''' Windows user credentials, call My.User.InitializeWithWindowsUser(). - ''' - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User - Get - Return s_User.GetInstance() - End Get - End Property - ''' - ''' Returns the application log. The listeners can be configured by the application's configuration file. - ''' - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log - Get - Return s_Log.GetInstance() - End Get - End Property - - ''' - ''' Returns the collection of Windows defined in the project. - ''' - _ - Friend ReadOnly Property Windows() As MyWindows - _ - Get - Return s_Windows.GetInstance() - End Get - End Property - _ - _ - Friend NotInheritable Class MyWindows - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T - If Instance Is Nothing Then - If s_WindowBeingCreated IsNot Nothing Then - If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.") - End If - Else - s_WindowBeingCreated = New Global.System.Collections.Hashtable() - End If - s_WindowBeingCreated.Add(GetType(T), Nothing) - Return New T() - s_WindowBeingCreated.Remove(GetType(T)) - Else - Return Instance - End If - End Function - _ - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T) - instance = Nothing - End Sub - _ - _ - Public Sub New() - MyBase.New() - End Sub - Private Shared s_WindowBeingCreated 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(MyWindows) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - End Module -End Namespace -Partial Class Application - Inherits Global.System.Windows.Application - _ - _ - Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo - _ - Get - Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly()) - End Get - End Property -End Class -#End If \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.Designer.vb deleted file mode 100644 index e7ecddcab..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:$clrversion$ -' -' 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.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("$safeprojectname$.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(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.resx b/tests/TestData/SmokeTests.WpfVbFramework/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.Designer.vb deleted file mode 100644 index 2d862e9e5..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/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(ByVal sender As Global.System.Object, ByVal 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.WpfApp1.My.MySettings - Get - Return Global.WpfApp1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.settings b/tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.settings deleted file mode 100644 index 40ed9fdba..000000000 --- a/tests/TestData/SmokeTests.WpfVbFramework/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/App.config b/tests/TestData/SmokeTests.WpfVbNet5Baseline/App.config deleted file mode 100644 index 193aecc67..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml b/tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml deleted file mode 100644 index a1e4723d6..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml.vb b/tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml.vb deleted file mode 100644 index 084cbe917..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/Application.xaml.vb +++ /dev/null @@ -1,6 +0,0 @@ -Class Application - - ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException - ' can be handled in this file. - -End Class diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml b/tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml deleted file mode 100644 index 9e5eac609..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml.vb b/tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml.vb deleted file mode 100644 index 922a5dedd..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/MainWindow.xaml.vb +++ /dev/null @@ -1,3 +0,0 @@ -Class MainWindow - -End Class diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/AssemblyInfo.vb deleted file mode 100644 index 261ce7b76..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,59 +0,0 @@ -Imports System -Imports System.Globalization -Imports System.Reflection -Imports System.Resources -Imports System.Runtime.InteropServices -Imports System.Windows - -' 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 - - - - - - - - - -'In order to begin building localizable applications, set -'CultureYouAreCodingWith in your .vbproj file -'inside a . For example, if you are using US english -'in your source files, set the to "en-US". Then uncomment the -'NeutralResourceLanguage attribute below. Update the "en-US" in the line -'below to match the UICulture setting in the project file. - -' - - -'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. -'1st parameter: where theme specific resource dictionaries are located -'(used if a resource is not found in the page, -' or application resource dictionaries) - -'2nd parameter: where the generic resource dictionary is located -'(used if a resource is not found in the page, -'app, and any theme specific resource dictionaries) - - - - -'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/SmokeTests.WpfVbNet5Baseline/My Project/MyExtensions/MyWpfExtension.vb b/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/MyExtensions/MyWpfExtension.vb deleted file mode 100644 index 22f84b7da..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/MyExtensions/MyWpfExtension.vb +++ /dev/null @@ -1,121 +0,0 @@ -#If _MyType <> "Empty" Then - -Namespace My - ''' - ''' Module used to define the properties that are available in the My Namespace for WPF - ''' - ''' - _ - Module MyWpfExtension - Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer) - Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User) - Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows) - Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log) - ''' - ''' Returns the application object for the running application - ''' - _ - Friend ReadOnly Property Application() As Application - Get - Return CType(Global.System.Windows.Application.Current, Application) - End Get - End Property - ''' - ''' Returns information about the host computer. - ''' - _ - Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer - Get - Return s_Computer.GetInstance() - End Get - End Property - ''' - ''' Returns information for the current user. If you wish to run the application with the current - ''' Windows user credentials, call My.User.InitializeWithWindowsUser(). - ''' - _ - Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User - Get - Return s_User.GetInstance() - End Get - End Property - ''' - ''' Returns the application log. The listeners can be configured by the application's configuration file. - ''' - _ - Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log - Get - Return s_Log.GetInstance() - End Get - End Property - - ''' - ''' Returns the collection of Windows defined in the project. - ''' - _ - Friend ReadOnly Property Windows() As MyWindows - _ - Get - Return s_Windows.GetInstance() - End Get - End Property - _ - _ - Friend NotInheritable Class MyWindows - _ - Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T - If Instance Is Nothing Then - If s_WindowBeingCreated IsNot Nothing Then - If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then - Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.") - End If - Else - s_WindowBeingCreated = New Global.System.Collections.Hashtable() - End If - s_WindowBeingCreated.Add(GetType(T), Nothing) - Return New T() - s_WindowBeingCreated.Remove(GetType(T)) - Else - Return Instance - End If - End Function - _ - _ - Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T) - instance = Nothing - End Sub - _ - _ - Public Sub New() - MyBase.New() - End Sub - Private Shared s_WindowBeingCreated 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(MyWindows) - End Function - Public Overrides Function ToString() As String - Return MyBase.ToString - End Function - End Class - End Module -End Namespace -Partial Class Application - Inherits Global.System.Windows.Application - _ - _ - Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo - _ - Get - Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly()) - End Get - End Property -End Class -#End If \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.Designer.vb deleted file mode 100644 index e7ecddcab..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:$clrversion$ -' -' 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.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("$safeprojectname$.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(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.resx b/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.Designer.vb deleted file mode 100644 index 2d862e9e5..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/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(ByVal sender As Global.System.Object, ByVal 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.WpfApp1.My.MySettings - Get - Return Global.WpfApp1.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.settings b/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.settings deleted file mode 100644 index 40ed9fdba..000000000 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file From e447cca3e5dd01558d3fa7fd1ff71da19afe1daa Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Thu, 22 Apr 2021 16:22:08 -0500 Subject: [PATCH 08/12] updates to includes --- .../SmokeTests.WpfVbNet5Baseline.vbproj | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj b/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj index 6f8f63be6..27b3440d0 100644 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj +++ b/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj @@ -21,6 +21,14 @@ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + + + + + + + + @@ -32,16 +40,16 @@ - + Microsoft.VisualBasic.WPF.MyExtension 1.0.0.0 - + True True Resources.resx - + True Settings.settings True From b35f46f5ffac6d760830b2bddb36185d1f06e883 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Mon, 26 Apr 2021 14:20:40 -0500 Subject: [PATCH 09/12] changed project helpers --- src/MSBuild.Abstractions/ProjectItemHelpers.cs | 13 ++++++++----- .../ProjectRootElementExtensionsForConversion.cs | 15 +-------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/MSBuild.Abstractions/ProjectItemHelpers.cs b/src/MSBuild.Abstractions/ProjectItemHelpers.cs index c6ddda04c..8e558436b 100644 --- a/src/MSBuild.Abstractions/ProjectItemHelpers.cs +++ b/src/MSBuild.Abstractions/ProjectItemHelpers.cs @@ -29,10 +29,12 @@ public static bool IsSpecificPacakgeReference(ProjectItemElement element, string /// Checks if a given item needs to be removed because it either only runs on desktop .NET or is automatically pulled in as a reference and is thus unnecessary. /// public static bool DesktopReferencesNeedsRemoval(ProjectItemElement item) => - DesktopFacts.ReferencesThatNeedRemoval.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - || DesktopFacts.KnownWPFReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - || DesktopFacts.KnownWinFormsReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - || DesktopFacts.KnownDesktopReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase); + !(item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) + && !string.IsNullOrWhiteSpace(item.Include)) + && (DesktopFacts.ReferencesThatNeedRemoval.Contains(item.Include, StringComparer.OrdinalIgnoreCase) + || DesktopFacts.KnownWPFReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) + || DesktopFacts.KnownWinFormsReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase) + || DesktopFacts.KnownDesktopReferences.Contains(item.Include, StringComparer.OrdinalIgnoreCase)); /// /// Checks if a given item is a desktop item that is globbed, so long as the metadata is a form type. @@ -48,7 +50,8 @@ public static bool IsDesktopRemovableGlobbedItem(ProjectStyle style, ProjectItem /// Checks if a given item is a well-known reference that can be converted to PackageReference. /// public static bool IsReferenceConvertibleToPackageReference(ProjectItemElement item) => - MSBuildFacts.DefaultItemsThatHavePackageEquivalents.ContainsKey(item.Include); + !item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(item.Include) + && MSBuildFacts.DefaultItemsThatHavePackageEquivalents.ContainsKey(item.Include); /// /// Checks if a reference is coming from an old-stlye NuGet package. diff --git a/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs b/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs index 63a07025f..807faed04 100644 --- a/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs +++ b/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs @@ -204,12 +204,7 @@ public static IProjectRootElement RemoveOrUpdateItems(this IProjectRootElement p } projectRootElement.AddPackage(packageName, version); - - // remove if this item is not an import element - if (!item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(item.Include)) - { - itemGroup.RemoveChild(item); - } + itemGroup.RemoveChild(item); } else if (ProjectItemHelpers.IsReferenceComingFromOldNuGet(item)) { @@ -270,7 +265,6 @@ static void UpdateBasedOnDiff(ImmutableArray itemsDiff, ProjectItemGr static bool IsDesktopRemovableItem(BaselineProject sdkBaselineProject, ProjectItemGroupElement itemGroup, ProjectItemElement item) { return sdkBaselineProject.ProjectStyle == ProjectStyle.WindowsDesktop - && !IsVbProjImportItem(item) && (ProjectItemHelpers.IsLegacyXamlDesignerItem(item) || ProjectItemHelpers.IsDependentUponXamlDesignerItem(item) || ProjectItemHelpers.IsDesignerFile(item) @@ -279,13 +273,6 @@ static bool IsDesktopRemovableItem(BaselineProject sdkBaselineProject, ProjectIt || ProjectItemHelpers.DesktopReferencesNeedsRemoval(item) || ProjectItemHelpers.IsDesktopRemovableGlobbedItem(sdkBaselineProject.ProjectStyle, item)); } - - static bool IsVbProjImportItem(ProjectItemElement item) - { - return item.ContainingProject.FullPath.EndsWith(".VBPROJ", StringComparison.OrdinalIgnoreCase) - && item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) - && !string.IsNullOrWhiteSpace(item.Include); - } } public static IProjectRootElement AddItemRemovesForIntroducedItems(this IProjectRootElement projectRootElement, ImmutableDictionary differs) From 5c0394edbd360c96838af80c017a3b8bae7482e0 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Mon, 26 Apr 2021 14:20:59 -0500 Subject: [PATCH 10/12] removed test noise --- .../My Project/Application.Designer.vb | 13 -- .../My Project/Application.myapp | 10 -- .../My Project/AssemblyInfo.vb | 18 --- .../My Project/Resources.Designer.vb | 62 ---------- .../My Project/Resources.resx | 117 ------------------ .../My Project/Settings.Designer.vb | 73 ----------- .../My Project/Settings.settings | 7 -- .../UnitTest1.vb | 9 -- .../packages.config | 5 - 9 files changed, 314 deletions(-) delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Application.Designer.vb delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Application.myapp delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/AssemblyInfo.vb delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.Designer.vb delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.resx delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.Designer.vb delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.settings delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/UnitTest1.vb delete mode 100644 tests/TestData/SmokeTests.MSTestVbNet5Baseline/packages.config diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Application.Designer.vb b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Application.Designer.vb deleted file mode 100644 index 88dd01c78..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/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/SmokeTests.MSTestVbNet5Baseline/My Project/Application.myapp b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Application.myapp deleted file mode 100644 index 758895def..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 1 - true - diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/AssemblyInfo.vb b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/AssemblyInfo.vb deleted file mode 100644 index b69315bdd..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,18 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - - - - - - - - - - - - -' - - diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.Designer.vb b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.Designer.vb deleted file mode 100644 index 6522f5e86..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.Designer.vb +++ /dev/null @@ -1,62 +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.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("MyVBTestProject.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(ByVal value As Global.System.Globalization.CultureInfo) - resourceCulture = value - End Set - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.resx b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/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 - - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.Designer.vb b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.Designer.vb deleted file mode 100644 index 9b9fabf18..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/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(ByVal sender As Global.System.Object, ByVal 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.MyVBTestProject.My.MySettings - Get - Return Global.MyVBTestProject.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.settings b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.settings deleted file mode 100644 index 85b890b3c..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/UnitTest1.vb b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/UnitTest1.vb deleted file mode 100644 index 9dd9a0801..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/UnitTest1.vb +++ /dev/null @@ -1,9 +0,0 @@ -Imports System.Text -Imports Microsoft.VisualStudio.TestTools.UnitTesting - - Public Class UnitTest1 - - Public Sub TestMethod1() - End Sub - -End Class \ No newline at end of file diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/packages.config b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/packages.config deleted file mode 100644 index e3b894841..000000000 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file From 9542b81b7d9ab8fe92daf6585320549d00ecc4d4 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Mon, 26 Apr 2021 14:21:38 -0500 Subject: [PATCH 11/12] packageReference to Microsoft.VisualBasic is no longer expected --- .../SmokeTests.MSTestVbNet5Baseline.vbproj | 1 - .../SmokeTests.WinformsVbKeepTfm.vbproj | 1 - .../SmokeTests.WpfVbNet5Baseline.vbproj | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/SmokeTests.MSTestVbNet5Baseline.vbproj b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/SmokeTests.MSTestVbNet5Baseline.vbproj index c8b5ae7f7..6c1b3c6ba 100644 --- a/tests/TestData/SmokeTests.MSTestVbNet5Baseline/SmokeTests.MSTestVbNet5Baseline.vbproj +++ b/tests/TestData/SmokeTests.MSTestVbNet5Baseline/SmokeTests.MSTestVbNet5Baseline.vbproj @@ -57,7 +57,6 @@ - diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj index cb10d78a3..6e82ec50f 100644 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj @@ -56,7 +56,6 @@ - \ No newline at end of file diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj b/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj index 27b3440d0..e98ce6c2d 100644 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj +++ b/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj @@ -56,7 +56,6 @@ - \ No newline at end of file From 3353dcc5c7c558af19828dcf50c7c8244af01f43 Mon Sep 17 00:00:00 2001 From: Ken Schlobohm Date: Mon, 26 Apr 2021 15:10:40 -0500 Subject: [PATCH 12/12] revert, do not keep elements that are included by default target file --- .../ProjectRootElementExtensionsForConversion.cs | 4 +--- .../SmokeTests.WinformsVbKeepTfm.vbproj | 9 --------- .../SmokeTests.WpfVbNet5Baseline.vbproj | 8 -------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs b/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs index 807faed04..fa9ff28b6 100644 --- a/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs +++ b/src/MSBuild.Conversion.Project/ProjectRootElementExtensionsForConversion.cs @@ -242,9 +242,7 @@ static void UpdateBasedOnDiff(ImmutableArray itemsDiff, ProjectItemGr if (!itemTypeDiff.DefaultedItems.IsDefault) { var defaultedItems = itemTypeDiff.DefaultedItems.Select(i => i.EvaluatedInclude); - if (defaultedItems.Contains(item.Include, StringComparer.OrdinalIgnoreCase) - // and this item is not an import element - && !item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(item.Include)) + if (defaultedItems.Contains(item.Include, StringComparer.OrdinalIgnoreCase)) { itemGroup.RemoveChild(item); } diff --git a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj index 6e82ec50f..98b46dcb3 100644 --- a/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj +++ b/tests/TestData/SmokeTests.WinformsVbKeepTfm/SmokeTests.WinformsVbKeepTfm.vbproj @@ -20,17 +20,8 @@ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - diff --git a/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj b/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj index e98ce6c2d..e330ac719 100644 --- a/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj +++ b/tests/TestData/SmokeTests.WpfVbNet5Baseline/SmokeTests.WpfVbNet5Baseline.vbproj @@ -21,14 +21,6 @@ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 - - - - - - - -