Skip to content

Commit 448f422

Browse files
CopilotBillWagnergewarren
authored
Add missing "To correct this error" content and Error IDs for Visual Basic error documentation (#48121)
* Initial plan * Add missing "To correct this error" content and Error IDs for 8 VB error documentation files Co-authored-by: BillWagner <[email protected]> * Apply suggestions from code review * Update docs/visual-basic/misc/bc31537.md * Update docs/visual-basic/misc/bc31537.md * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Genevieve Warren <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BillWagner <[email protected]> Co-authored-by: Bill Wagner <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent c5a40f8 commit 448f422

File tree

8 files changed

+64
-0
lines changed

8 files changed

+64
-0
lines changed

docs/visual-basic/misc/bc30981.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ ms.assetid: fb68e246-c135-4e7a-a1be-12d83dbcf96f
1111
---
1212
# \<member> in class \<class> cannot override \<baseMember> in class \<baseClass> because an intermediate class \<intermediateClass> overrides \<member> in class \<baseClass> but is not accessible.
1313

14+
**Error ID:** BC30981
15+
1416
## To correct this error
1517

18+
- Change the inheritance structure to directly inherit from the base class instead of going through the intermediate class.
19+
- Make the intermediate class accessible by changing its access modifier to `Public` or an appropriate level.
20+
- Override the member at the appropriate level in the inheritance hierarchy where it is accessible.
21+
- Review the class design to ensure proper access levels throughout the inheritance chain.
22+
1623
## See also
1724

1825
- [Access levels in Visual Basic](../programming-guide/language-features/declared-elements/access-levels.md)

docs/visual-basic/misc/bc31199.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ ms.assetid: c150778e-c82d-4e6e-acc0-06080eece1d1
1515

1616
## To correct this error
1717

18+
- Update to a supported version of .NET Framework that includes the required components for Win32 manifest embedding.
19+
- Remove the `/win32manifest` compiler option if Win32 manifest embedding is not required for your project.
20+
- Verify that the .NET Framework installation is complete and includes the necessary updates for manifest support.
21+
1822
## See also
1923

2024
- [-win32manifest (Visual Basic)](../reference/command-line-compiler/win32manifest.md)

docs/visual-basic/misc/bc31536.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ ms.assetid: ce87cc25-ab61-4d5f-b0f8-2e87cc479d62
1515

1616
## To correct this error
1717

18+
- Add the public key information in the project settings for the friend assembly.
19+
- Use the command-line compiler switch to specify the public key:
20+
21+
```dotnetcli
22+
vbc /keyfile:mykey.snk /reference:friendassembly.dll mycode.vb
23+
```
24+
25+
- Add the public key information to the `InternalsVisibleTo` attribute in the friend assembly:
26+
27+
```vb
28+
<Assembly: InternalsVisibleTo("YourAssembly, PublicKey=<public_key_token>")>
29+
```
30+
31+
- Ensure both assemblies use the same strong naming key if strong naming is required.
32+
- Check that the friend assembly declaration is correctly formatted and the assembly name matches exactly.
33+
1834
## See also
1935

2036
- <xref:System.Reflection.AssemblyName>

docs/visual-basic/misc/bc31537.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ ms.assetid: a5b88d90-ce11-44cb-8df2-457f661a553b
1515

1616
## To correct this error
1717

18+
- Verify that the friend declaration syntax is correct and the assembly name is valid.
19+
- Check that the referenced assembly exists and is accessible:
20+
21+
```vb
22+
' Ensure the assembly reference is correct
23+
<Assembly: InternalsVisibleTo("ValidAssemblyName")>
24+
```
25+
26+
- Confirm that the strong name or public key token matches between assemblies if strong naming is used.
27+
- Ensure the friend assembly has been compiled and is available to the current project.
28+
1829
## See also
1930

2031
- <xref:System.Reflection.AssemblyName>

docs/visual-basic/misc/bc31538.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,18 @@ ms.assetid: a0b13f40-eee2-46fd-9e85-11c3988f7a95
1111
---
1212
# Member \<member> cannot override member \<baseMember> defined in another assembly/project because…
1313

14+
**Error ID:** BC31538
15+
1416
## To correct this error
1517

18+
Review the access levels of the base member in the referenced assembly to determine the appropriate modifier. Ensure the overriding member does not expand the accessibility of the base member being overridden. For example, change the access modifier from `Protected Friend` to `Protected` for the overriding member:
19+
20+
```vb
21+
' Instead of Protected Friend (which expands access)
22+
Protected Overrides Sub MyMethod()
23+
' Use Protected (which matches the base member access level)
24+
```
25+
1626
## See also
1727

1828
- [Friend](../language-reference/modifiers/friend.md)

docs/visual-basic/misc/bc36613.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ms.assetid: 592d52a2-7442-472c-8b84-9dc63e24ba79
1515

1616
## To correct this error
1717

18+
Ensure the XML identifier follows Visual Basic naming rules (starts with letter or underscore, contains only letters, digits, and underscores), or use a valid Visual Basic identifier for the property name explicitly.
19+
1820
## See also
1921

2022
- [Declared Element Names](../programming-guide/language-features/declared-elements/declared-element-names.md)

docs/visual-basic/misc/bc36614.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ms.assetid: cfa9a854-c70e-4f10-a009-2686c650ca2b
1515

1616
## To correct this error
1717

18+
Ensure the XML identifier follows Visual Basic naming rules when used as a range variable (starts with letter or underscore, contains only letters, digits, and underscores), or use a valid Visual Basic identifier for the range variable name explicitly.
19+
1820
## See also
1921

2022
- [Introduction to LINQ in Visual Basic](../programming-guide/language-features/linq/introduction-to-linq.md)

docs/visual-basic/misc/bc42207.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ ms.assetid: c6129559-7273-4abe-b2f1-deea05d242c9
1515

1616
## To correct this error
1717

18+
- Verify that the assembly reference path is correct and the assembly file exists:
19+
20+
```vb
21+
' Check the assembly reference in project settings
22+
' Ensure the file path is valid and accessible
23+
```
24+
25+
- Confirm that the referenced assembly is compiled for a compatible target framework.
26+
- Check that the assembly is not corrupted by trying to reference it in a new test project.
27+
- If the assembly requires dependencies, ensure they are also available and properly referenced.
28+
- Update the assembly reference to point to the correct version or location of the assembly.
29+
1830
## See also
1931

2032
- [Visual Basic Command-Line Compiler](../reference/command-line-compiler/index.md)

0 commit comments

Comments
 (0)