Home > Articles > Programming

Like this article? We recommend

Configuring Assemblies

As the .NET Framework matures, Microsoft will introduce new versions. In addition, your custom assemblies will undoubtedly undergo revision. Eventually, you'll end up with applications that request everything from the latest version to the first version of a particular assembly.

The use of side-by-side installation means that the Common Language Runtime (CLR) can honor every assembly request, as long as the target system has the required version of that assembly installed. At some point, administrators are going to remove older versions of these assemblies from systems, which means that some applications could fail unless the system provides a means of honoring the request. This need brings a binding policy into play. The binding policy tells the CLR that it's okay to use a newer version of an assembly to honor requests for an older version.

In addition to the problem of older assemblies, there's the issue of locating and installing newer versions of an assembly. Microsoft assumes that you'll want the system to download the newer version from a central location that need not be on the Internet. Setting a code base for an assembly tells the system where to look for updates.

You configure both of these options using the entries in the Configured Assemblies folder. In both cases, click Configure an Assembly. When you see the Configure an Assembly dialog box, select one of the assembly identification options. You can choose an assembly from the GAC or enter the assembly information by hand. (Choosing the assembly from the GAC is much easier.) Click Finish and you'll see a Properties dialog box for the assembly, similar to the one shown in Figure 2.

Figure 2 shows the Binding Policy tab. The entry in the figure tells the CLR that whenever an application requests the 1.0 version of this assembly, the CLR should load the newer 1.0.1665.28688 version instead. You can create as many binding policies as needed to ensure that applications run flawlessly.

Figure 2Figure 2 Configure assemblies as needed to respond to specific application needs.

The Codebases tab in the dialog box lets you define a location for downloads. Like the Binding Policy tab, this tab displays two columns. The first column contains the assembly version. You can enter as many assembly versions as needed to support the applications you create. The URI column lists the location for the assembly; you can include network or even local folders by specifying the file protocol like this:

file:///D:/MyMathClass/MyMathClass.dll

To remove or modify a configuration entry, click View List of Configured Assemblies in the Configured Assemblies folder. Right-click the assembly entry and choose Properties from the context menu to modify the current settings. Right-click the assembly entry and choose Delete to remove the assembly from the configured list.

Changing Assembly Security

Normally, you'll want to use code to set the security level of an assembly. Using this technique means that the assembly is ready to use the moment someone installs it. In the past, the security level of an assembly often didn't matter because Windows wasn't very good at enforcing security policies. However, starting with Windows XP Service Pack 2, security policies matter a great deal. This change in Windows capability means that sometimes you need to set the security level of an assembly manually, as described in the following steps:

  1. Select the Runtime Security Policy folder. This folder contains the security settings for the assemblies.

  2. Click Increase Assembly Trust to open the Trust an Assembly dialog box.

  3. Select the option Make Changes to This Computer; then click Next.

  4. When the wizard asks which assembly you want to trust, locate the assembly file that you want to change. Click Next.

  5. When the wizard asks what level of security you want to assign to the assembly, set the slider for this assembly to Full Trust. Click Next and then verify the settings in the Completing the Wizard dialog box.

  6. Click Finish. The assembly is now ready for use at its current location. If you move the assembly, you must also reset the security.

Working with Code Groups

One of the security principles that the .NET Framework uses is the idea of an assembly presenting evidence to the CLR that the assembly meets the requirements of the security policy for the system—essentially, the law for that system. One of the more important pieces of evidence that an assembly can provide is membership in a particular code group. The assembly enjoys the same privileges and restrictions that the code group enjoys, so proof of membership is important.

The .NET Framework comes with only one code group by default: the All_Code group. The Enterprise, Machine, and User policies all support this code group, and you'll generally use it for all local programs. However, you can modify how the code groups work and even add new code groups as the need arises. Any new code group you add will appear below the All_Code group in the hierarchy. In fact, Microsoft adds a few of these entries to the Machine policy for you, as shown in Figure 3.

When you first select Runtime Security Policy, <Level>, Code Groups, All_Code in the left pane of the .NET Configuration tool, you'll get a help screen. This screen contains options for adding new code groups or configuring the existing code group, as shown in Figure 3. (This figure also shows the location of the All_Code entry in the hierarchy.)

Figure 3Figure 3 Add or edit code groups using this help screen.

You can use one of three methods to create a new code group. Click the Add a Child Code Group link to open a Create Code Group dialog box. This dialog box contains two of the methods for adding a new code group: first, an option to create the code group manually; second, an option to import an XML file that contains the code you want to use. The third method is to right-click an existing code group and choose the Duplicate entry from the context menu. This technique creates a code group with the same characteristics as the parent.

If you choose to create a code group manually, you pass through several dialog boxes. Each dialog box asks a question about the new code group, including the condition type (such as Application Directory, Zone, or Hash) and the permission set (such as Full Trust, Execution, or Internet). Editing a code group means changing features such as the condition type and the permission set. When you click Edit Code Group Properties on the help screen, you get a Properties dialog box that you can use to determine how the code group will work with the policy levels. The first check box lets you set the code group exclusively to use permissions associated with the permission set for the code group. The second tells the CLR not to evaluate policy levels below the existing policy level. In other words, this check box creates an exclusive code group.

Creating and Defining Permission Sets

The .NET Framework comes with a standard set of permissions. You can create additional permission sets as required to meet specific programming needs. In addition, you can modify the definitions for existing permissions. However, modifying a current permission isn't a good idea because that action will change the default meaning of the permission and could cause applications written by other developers to fail. (The CLR prevents you from changing .NET Framework–specific permission sets.)

You have the same options for creating a new permission set as described in the preceding section, "Working with Code Groups." Creating a new permission manually displays the Create Permission Set dialog box. The first screen asks for a name and description for the permission set. The second screen asks you to define the permission for the permission set, as shown in Figure 4.

Figure 4Figure 4 To avoid security breaches, define the permissions carefully for your new permission set.

Whenever you add a new permission, the .NET Configuration tool displays a Permission Settings dialog box that helps you configure that particular permission. The dialog boxes vary by permission. For example, the File IO permission includes a setting that lets you define individual permissions for each drive you want the permission set to access, or you can grant unlimited drive access. You can click Import to import an XML file containing the permissions you want to use. Custom permission sets include a help screen that lets you view, change, and rename the permission set.

Defining Policy Assemblies

Policy assemblies contain the code used by the CLR to evaluate the evidence presented by an object to obtain a permission. The default .NET Framework configuration is all you need, unless you design a special policy that requires additional code. When you create a unique policy, you must add the assembly to the appropriate list, or the evaluation will always fail. Unfortunately, you may find that .NET is less than helpful in telling you about this problem. It always appears as a security error.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020