You receive a "System.Security.SecurityException occurred in Unknown Module" error message when you try to change the driver status programmatically for an add-in program in Microsoft Office Small Business Accounting (839158)



The information in this article applies to:

  • Microsoft Office Small Business Accounting 2006
  • Microsoft Office Small Business Management Edition 2006
  • Microsoft Office Small Business Accounting 2006 Software Development Kit 1.2

SYMPTOMS

When you develop an add-in program in Microsoft Office Small Business Accounting, and you try to change the driver status programmatically by using the DriverRegistration.ChangeDriverStatus method, you receive the following error message:

An unhandled exception of type System.Security.SecurityException occurred in Unknown Module.
Additional information:
Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

CAUSE

The exception occurs by design. The status of a driver can be changed only from within Small Business Accounting.

RESOLUTION

To resolve this problem, you can change the driver status in the Add-in Manager dialog box. To open the Add-in Manager dialog box, point to Utilities on the File menu, and then click Add-in Manager.

MORE INFORMATION

Steps to reproduce the problem

In a Small Business Accounting integration, run the following code.
DriverRegistration dr = (DriverRegistration)iSbi.DriverRegistrations.GetByPrimaryKey(236);

if (dr != null)
{
	dr.ChangeDriverStatus(DriverStatus.Enabled);
}

Modification Type:MinorLast Reviewed:4/4/2006
Keywords:kbtshoot kbMBSMigrate kbprb KB839158 kbAudEndUser