RuntimeManager.Bind Error migrating Engine app to 10.4.1

1576
1
Jump to solution
08-10-2016 09:57 AM
ThomasCox
Occasional Contributor

I am upgrading ArcEngine applications from 10.3 to 10.4.1 and am encountering an error when the RuntimeManager tries to bind to the product code.

I have revised the target framework for the application's projects to .net framework 4.5 and assigned the ESRI dll references to false regarding

The solution successfully builds, but when I try to run the application through Visual Studio I encounter the following error:

     "An unhandled exception of type 'System.MethodAccessException occcurred in ......exe

     Additional information: Attempt by security transparent method '...exe to access security critical method

     'ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode)' failed

      

I have included a screen shot of the error as an attachment

These Engine applications have been upgraded for numerous versions with out any grief regarding the RuntimeManager binding bit. I am assuming there is something related to the new framework target.

Any assistance would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
ThomasCox
Occasional Contributor

I believe I have found the resolution to my issue.  I discovered the following stackoverflow site that suggested the fix:

c# - Visual studio security problems when running projects - Trust levels - Stack Overflow

I followed the tip to add [assembly:SecurityRules(SecurityRuleSet.Level1)] to the application's AssemblyInfo.cs file. Thanks to Anthony Langsworth for the answer. I rebuilt the solution and it successfully launched through Visual Studio.  Hopefully, there is not more heartburn regarding deployment.

View solution in original post

1 Reply
ThomasCox
Occasional Contributor

I believe I have found the resolution to my issue.  I discovered the following stackoverflow site that suggested the fix:

c# - Visual studio security problems when running projects - Trust levels - Stack Overflow

I followed the tip to add [assembly:SecurityRules(SecurityRuleSet.Level1)] to the application's AssemblyInfo.cs file. Thanks to Anthony Langsworth for the answer. I rebuilt the solution and it successfully launched through Visual Studio.  Hopefully, there is not more heartburn regarding deployment.