Microsoft Certified Solutions Developer (MCSD) Certification Practice Test

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Microsoft Certified Solutions Developer Certification Test. Use multiple choice quizzes with hints and explanations to boost your readiness. Excel on your test!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


How can you expose internal types to another assembly?

  1. By using the InternalExposeAttribute

  2. By applying the InternalsVisibleToAttribute

  3. By modifying the assembly configuration

  4. By creating a public static class

The correct answer is: By applying the InternalsVisibleToAttribute

Applying the InternalsVisibleToAttribute allows you to expose internal types and members of one assembly to another specified assembly. This attribute is particularly useful for unit testing scenarios or where one assembly needs access to the internals of another for purposes such as debugging or testing without needing to make those internal types public. When you use this attribute, you specify the name of the assembly that can access the internal members, thereby granting it special rights to those internal classes or methods. This is a secure way of sharing parts of your codebase without exposing everything publicly. The other options do not achieve the same result; for instance, there is no InternalExposeAttribute defined in C#, and modifying the assembly configuration generally pertains to settings rather than access control. Creating a public static class would make the class public, but it wouldn't provide access to internal members unless they are also declared public. The InternalsVisibleToAttribute is the designated mechanism to achieve this specific type of access control in C#.