Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InternalsVisibleTo item type to common types schema #6777

Closed
DamianEdwards opened this issue Aug 20, 2021 · 0 comments · Fixed by #6778
Closed

Add InternalsVisibleTo item type to common types schema #6777

DamianEdwards opened this issue Aug 20, 2021 · 0 comments · Fixed by #6778
Labels
needs-triage Have yet to determine what bucket this goes in.

Comments

@DamianEdwards
Copy link
Member

DamianEdwards commented Aug 20, 2021

Since .NET 5, the <InternalsVisibleTo Include="MyProject.Assmebly" /> item type has been supported to generate the System.Runtime.CompilerServices.InternalsVisibleTo for the output assembly. The definition for this item type should be in the common types schema file so that editors (like Visual Studio) provide statement completion and a QuickInfo tooltip for it.

Example use (.csproj)

<ItemGroup>
  <InternalsVisibleTo Include="MyProject" />
  <InternalsVisibleTo Include="MyProject.WithPublicKey" PublicKey="002400000..." />
</ItemGroup>

Schema file update

<xs:element name="InternalsVisibleTo" substitutionGroup="msb:Item">
  <xs:annotation>
    <xs:documentation>
      <!-- _locID_text="InternalsVisibleTo" _locComment="" -->Specifies that types that are ordinarily visible only within the assembly are visible to the specified assemblies.
    </xs:documentation>
  </xs:annotation>
  <xs:complexType>
      <xs:complexContent>
        <xs:extension base="msb:SimpleItemType">
          <xs:attribute name="Include" type="xs:string">
            <xs:annotation>
              <xs:documentation>
                <!-- _locID_text="InternalsVisibleTo_Include" _locComment="" -->The name of the friend assembly to make internal types visible to, e.g. Microsoft.AspNetCore.
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="PublicKey" type="xs:string" use="optional">
            <xs:annotation>
              <xs:documentation>
                <!-- _locID_text="InternalsVisibleTo_PublicKey" _locComment="" -->Optional public key associated with the strong name signature of the friend assembly.
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
@DamianEdwards DamianEdwards added the needs-triage Have yet to determine what bucket this goes in. label Aug 20, 2021
Forgind pushed a commit that referenced this issue Aug 26, 2021
Fixes #6777

Since .NET 5, the <InternalsVisibleTo Include="MyProject.Assmebly" /> item type has been supported to generate the System.Runtime.CompilerServices.InternalsVisibleTo for the output assembly. The definition for this item type should be in the common types schema file so that editors (like Visual Studio) provide statement completion and a QuickInfo tooltip for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant