Microsoft KB Archive/839158

= Error message when you try to change the driver status for an add-in program in Accounting Professional 2007, in Accounting Express 2007, or in Small Business Accounting 2007: &quot;System.Security.SecurityException occurred in Unknown Module&quot; =

Article ID: 839158

Article Last Modified on 2/8/2007

-

APPLIES TO


 * Microsoft Office Accounting Professional 2007
 * Microsoft Office Accounting Express 2007
 * 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
Consider the following scenario. You develop an add-in program in any one of the following programs:
 * Microsoft Office Accounting Professional 2007
 * Microsoft Office Accounting Express 2007
 * Microsoft Office Small Business Accounting 2006

When 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 Accounting Professional 2007, from within Accounting Express 2007, or from within Small Business Accounting 2006.



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.



Steps to reproduce the problem
Run the following code in an integration for Accounting Professional 2007, for Accounting Express 2007, or for Small Business Accounting 2006. DriverRegistration dr = (DriverRegistration)iSbi.DriverRegistrations.GetByPrimaryKey(236);

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

Additional query words: Content Maintenance 40730, SBA, SDK

Keywords: kbtshoot kbprb kbmbsmigrate KB839158

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.