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 (MCSD) Certification Exam. Practice with flashcards and multiple choice questions. Master each topic with hints and insights. Achieve your certification goals!

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.


What are two ways to specify CAS in code?

  1. Only declarative CAS available

  2. Declarative and imperative CAS

  3. Binary and assembly CAS

  4. XML and JSON CAS

The correct answer is: Declarative and imperative CAS

The correct answer highlights the two primary ways to specify Code Access Security (CAS) in .NET applications: declarative and imperative. Declarative CAS is implemented using attributes, which are attached directly to the code. This means developers can define the security requirements of their code at a high level by decorating class or method definitions with specific attributes that indicate the permissions the code requires or is granted. This approach is easier to read and maintain, as the security logic is clear from the annotations. Imperative CAS, on the other hand, allows for more dynamic control of security checks at runtime. Developers can specify permissions programmatically using the security classes provided in the .NET framework. This enables more complex scenarios where the security requirements may depend on various runtime conditions, allowing for greater flexibility in handling security. These two methods collectively give developers the ability to control access to resources and operations in a fine-grained manner. They are essential for securing applications and ensuring that they comply with the intended security policies. The other options do not accurately depict the methods of specifying CAS. For instance, binary and assembly CAS does not align with the established practices of implementing security in code. Similarly, XML and JSON CAS refer to data formats rather than the mechanisms for defining security in .NET