VKoen

Private Sub _cbb_Click1(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) _
        Handles _cbb.Click

        Dim form As New frmMyCExport()
        form.Show()
End Sub

I created an Outlook Add-In which adds a toolbar with one button in an Outlook Inspector. So far so good.

On this line (Dim form As New frmMyCExport()) following exception is trown :
"Could not load file or assembly 'Datalogic, version....'. Failed to grant permission to execute.

frmMyCExport makes uses of that assembly. How do I grant permission to that assembly

I use:
-Windows XP SP2
-Outlook 2003
-.Net-Framework 2.0
-VSTO Runtime
-Outlook PIA



Re: Visual Studio Tools for Office Outlook Add-In - No permission to execute assembly

HawVer

Make sure that the controls you added to the toolbar are not created local. Cause when you create the controls in a procedure the gc removes the references to the controls and their eventlisteners when you exit the function. Create the controls as class variables or add them to an arraylist for example.

.edit.
Oops. sorry, I must read more carefully. :$






Re: Visual Studio Tools for Office Outlook Add-In - No permission to execute assembly

John R. Durant - MSFT

VKoen,

Just because your add-in DLL has perms to execute does not mean that one of its dependencies is, by extension, also granted persmission. The mechanism you use to grant permission is up to you. You can use caspol to grant the permissions. Or, you can include this as a special action in your installer.

This feature of requiring trust can be inconvenient at times, but it helps protect your resources.

Best,

John.