Skip to content

Commit 9dfaaa1

Browse files
committed
Address build failures
1 parent 8afff4b commit 9dfaaa1

File tree

54 files changed

+109
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+109
-185
lines changed

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
<LangVersion>preview</LangVersion>
1717
</PropertyGroup>
1818

19+
<!-- SDK flipped to 'true' by default https://github.com/dotnet/sdk/pull/12720 -->
20+
<PropertyGroup>
21+
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
22+
</PropertyGroup>
23+
1924
<!-- Allow SourceLink to work for strongly types resource files (SR) by embeddeding generated files into the PDBs -->
2025
<PropertyGroup>
2126
<EmbedUntrackedSources>true</EmbedUntrackedSources>

eng/Shipping.ruleset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@
237237
<Rule Id="CA1308" Action="None" /> <!-- Normalize strings to uppercase -->
238238
<Rule Id="CA1309" Action="None" /> <!-- Use ordinal stringcomparison -->
239239
<Rule Id="CA1401" Action="Warning" /> <!-- P/Invokes should not be visible -->
240+
<Rule Id="CA1416" Action="None" /> <!-- Validate platform compatibility -->
240241
<Rule Id="CA1417" Action="Warning" /> <!-- Do not use 'OutAttribute' on string parameters for P/Invokes -->
241242
<Rule Id="CA1501" Action="None" /> <!-- Avoid excessive inheritance -->
242243
<Rule Id="CA1502" Action="None" /> <!-- Avoid excessive complexity -->

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/ApplicationBase.vb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices
1818
Public Sub New()
1919
End Sub
2020

21-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
2221
''' <summary>
2322
''' Returns the value of the specified environment variable.
2423
''' </summary>
@@ -27,7 +26,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices
2726
''' <exception cref="ArgumentNullException">if name is Nothing.</exception>
2827
''' <exception cref="ArgumentException">if the specified environment variable does not exist.</exception>
2928
Public Function GetEnvironmentVariable(name As String) As String
30-
#Enable Warning CA1822 ' Mark members as static
3129

3230
' Framework returns Null if not found.
3331
Dim VariableValue As String = Environment.GetEnvironmentVariable(name)
@@ -94,7 +92,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices
9492
End Get
9593
End Property
9694

97-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
9895
''' <summary>
9996
''' Changes the culture currently in used by the current thread.
10097
''' </summary>
@@ -117,7 +114,6 @@ Namespace Microsoft.VisualBasic.ApplicationServices
117114
Public Sub ChangeUICulture(cultureName As String)
118115
Threading.Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo(cultureName)
119116
End Sub
120-
#Enable Warning CA1822 ' Mark members as static
121117

122118
Private _log As Logging.Log 'Lazy-initialized and cached log object.
123119
Private _info As AssemblyInfo ' The executing application (the EntryAssembly)

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
' Licensed to the .NET Foundation under one or more agreements.
1+
' Licensed to the .NET Foundation under one or more agreements.
22
' The .NET Foundation licenses this file to you under the MIT license.
33
' See the LICENSE file in the project root for more information.
44

@@ -442,12 +442,10 @@ Namespace Microsoft.VisualBasic.ApplicationServices
442442
End Set
443443
End Property
444444

445-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
446445
''' <summary>
447446
''' Processes all windows messages currently in the message queue
448447
''' </summary>
449448
Public Sub DoEvents()
450-
#Enable Warning CA1822 ' Mark members as static
451449
Windows.Forms.Application.DoEvents()
452450
End Sub
453451

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Audio.vb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
' Licensed to the .NET Foundation under one or more agreements.
1+
' Licensed to the .NET Foundation under one or more agreements.
22
' The .NET Foundation licenses this file to you under the MIT license.
33
' See the LICENSE file in the project root for more information.
44

@@ -85,7 +85,6 @@ Namespace Microsoft.VisualBasic
8585
Play(New Media.SoundPlayer(stream), playMode)
8686
End Sub
8787

88-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
8988
''' <summary>
9089
''' Plays a system messageBeep sound.
9190
''' </summary>
@@ -107,7 +106,6 @@ Namespace Microsoft.VisualBasic
107106
Dim sound As New Media.SoundPlayer()
108107
sound.Stop()
109108
End Sub
110-
#Enable Warning CA1822 ' Mark members as static
111109

112110
''' <summary>
113111
''' Plays the passed in SoundPlayer in the passed in mode

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Keyboard.vb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@ Namespace Microsoft.VisualBasic.Devices
2424
SendKeys(keys, False)
2525
End Sub
2626

27-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
2827
''' <summary>
2928
''' Sends keys to the active window as if typed at keyboard. This overloaded
3029
''' version uses the same conventions as the VB6 SendKeys.
3130
''' </summary>
3231
''' <param name="keys">A string containing the keys to be sent (typed).</param>
3332
''' <param name="wait">Wait for messages to be processed before returning.</param>
3433
Public Sub SendKeys(keys As String, wait As Boolean)
35-
#Enable Warning CA1822 ' Mark members as static
3634
If wait Then
3735
Windows.Forms.SendKeys.SendWait(keys)
3836
Else

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Devices/Network.vb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
' Licensed to the .NET Foundation under one or more agreements.
1+
' Licensed to the .NET Foundation under one or more agreements.
22
' The .NET Foundation licenses this file to you under the MIT license.
33
' See the LICENSE file in the project root for more information.
44

@@ -334,7 +334,6 @@ Namespace Microsoft.VisualBasic.Devices
334334

335335
End Sub
336336

337-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
338337
''' <summary>
339338
''' Downloads a file from the network to the specified path
340339
''' </summary>
@@ -353,8 +352,6 @@ Namespace Microsoft.VisualBasic.Devices
353352
connectionTimeout As Integer,
354353
overwrite As Boolean,
355354
onUserCancel As UICancelOption)
356-
#Enable Warning CA1822 ' Mark members as static
357-
358355
If connectionTimeout <= 0 Then
359356
Throw GetArgumentExceptionWithArgName("connectionTimeOut", SR.Network_BadConnectionTimeout)
360357
End If
@@ -581,7 +578,6 @@ Namespace Microsoft.VisualBasic.Devices
581578
UploadFile(sourceFileName, address, networkCredentials, showUI, connectionTimeout, UICancelOption.ThrowException)
582579
End Sub
583580

584-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
585581
''' <summary>
586582
''' Uploads a file from the local machine to the specified host
587583
''' </summary>
@@ -597,8 +593,6 @@ Namespace Microsoft.VisualBasic.Devices
597593
showUI As Boolean,
598594
connectionTimeout As Integer,
599595
onUserCancel As UICancelOption)
600-
#Enable Warning CA1822 ' Mark members as static
601-
602596
sourceFileName = FileSystemUtils.NormalizeFilePath(sourceFileName, "sourceFileName")
603597

604598
'Make sure the file exists

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Helpers/NativeMethods.vb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Namespace Microsoft.VisualBasic.CompilerServices
2727
GetDesktopWindow _
2828
Lib "user32" () As IntPtr
2929

30-
#Disable Warning CA2101 ' Specify marshaling for P/Invoke string arguments
30+
#Disable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes
3131
<DllImport("user32", CharSet:=CharSet.Auto, PreserveSig:=True, SetLastError:=True)>
3232
Friend Shared Function GetWindowText(hWnd As IntPtr, <Out(), MarshalAs(UnmanagedType.LPTStr)> lpString As StringBuilder, nMaxCount As Integer) As Integer
33-
#Enable Warning CA2101 ' Specify marshaling for P/Invoke string arguments
33+
#Enable Warning CA1838 ' Avoid 'StringBuilder' parameters for P/Invokes
3434
End Function
3535

3636
<PreserveSig()>
@@ -48,12 +48,10 @@ Namespace Microsoft.VisualBasic.CompilerServices
4848
SetFocus _
4949
Lib "user32" (hwnd As IntPtr) As IntPtr
5050

51-
#Disable Warning CA2101 ' Specify marshaling for P/Invoke string arguments
5251
<PreserveSig()>
5352
Friend Declare Auto Function _
5453
FindWindow _
5554
Lib "user32" (lpClassName As String, lpWindowName As String) As IntPtr
56-
#Enable Warning CA2101 ' Specify marshaling for P/Invoke string arguments
5755

5856
<PreserveSig()>
5957
Friend Declare Function _

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/Interaction.vb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
' Licensed to the .NET Foundation under one or more agreements.
1+
' Licensed to the .NET Foundation under one or more agreements.
22
' The .NET Foundation licenses this file to you under the MIT license.
33
' See the LICENSE file in the project root for more information.
44

5-
Imports System.Text
6-
Imports System.Threading
75
Imports System.Runtime.CompilerServices
86
Imports System.Runtime.InteropServices
97
Imports System.Security
10-
8+
Imports System.Text
9+
Imports System.Threading
1110
Imports Microsoft.VisualBasic.CompilerServices
1211
Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils
1312
Imports Microsoft.VisualBasic.CompilerServices.Utils
@@ -261,10 +260,8 @@ Namespace Microsoft.VisualBasic
261260
Public Sub StartHere()
262261
Try
263262
_result = InternalInputBox(_prompt, _title, _defaultResponse, _xPos, _yPos, _parentWindow)
264-
#Disable Warning CA1031 ' Do not catch general exception types
265263
Catch ex As Exception
266264
_exception = ex
267-
#Enable Warning CA1031 ' Do not catch general exception types
268265
End Try
269266
End Sub
270267

src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/MyServices/ClipboardProxy.vb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
' Licensed to the .NET Foundation under one or more agreements.
1+
' Licensed to the .NET Foundation under one or more agreements.
22
' The .NET Foundation licenses this file to you under the MIT license.
33
' See the LICENSE file in the project root for more information.
44

@@ -26,7 +26,6 @@ Namespace Microsoft.VisualBasic.MyServices
2626
Friend Sub New()
2727
End Sub
2828

29-
#Disable Warning CA1822 ' Mark members as static, Justification:=<Public API>
3029
''' <summary>
3130
''' Gets text from the clipboard
3231
''' </summary>
@@ -212,6 +211,5 @@ Namespace Microsoft.VisualBasic.MyServices
212211
Public Sub SetDataObject(data As System.Windows.Forms.DataObject)
213212
Clipboard.SetDataObject(data)
214213
End Sub
215-
#Enable Warning CA1822 ' Mark members as static
216214
End Class
217215
End Namespace

0 commit comments

Comments
 (0)