| Author |  | 
      
        | kmeli Newbie
 
  
 
 Joined: 09 April 2012
 Location: United States
 Online Status: Offline
 Posts: 5
 | 
          
           | Posted: 22 May 2012 at 5:23am | IP Logged |   |  
           | 
 |  When running the service with the new MailBee DLL, I receive the following exception:
 
 Attempt by security transparent method 'a.b.an.a(Int32)' to call native code through method 'a.b.an.FormatMessage(Int32, IntPtr, Int32, Int32, IntPtr ByRef, Int32, IntPtr)' failed.  Methods must be security critical or security safe-critical to call native code.
 
 I have reverted back to the older version   Does anyone know what this means please
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          To assist you on that, we need to know whether you have .NET Framework 4 installed, and which DLL versions you selected to be installed - for .NET Framework 2+, for 4 or both.
           | Posted: 22 May 2012 at 5:29am | IP Logged |   |  
           | 
 |  
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | kmeli Newbie
 
  
 
 Joined: 09 April 2012
 Location: United States
 Online Status: Offline
 Posts: 5
 | 
          HI
           | Posted: 22 May 2012 at 5:10pm | IP Logged |   |  
           | 
 |  .Net 4.0 is installed.
 Selected both 2 and 4 to install
 Using MailBee.NET.4.dll library
 What else should I be looking at please?
 Thank you
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Reinstall with .net 2.0-only version and try using that version. Does it change anything?
           | Posted: 23 May 2012 at 12:33pm | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | kmeli Newbie
 
  
 
 Joined: 09 April 2012
 Location: United States
 Online Status: Offline
 Posts: 5
 | 
          Is there a reason the .net 4.0 does not work?  We are using it in a 64 bit enviroment as well and the rest of the code is all 4.0   We are going to try that but would really perfer the .net 4.0 if that is possible
           | Posted: 22 June 2012 at 1:27pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          To the moment, we don't even know what exactly isn't working in your setup. That's why we're asking to select 2.0 only install. It if works, we'll know it's 4.0 what's causing problems, and move ahead from there. Or, maybe, we'll find it occurs only if both 2.0 and 4.0 are installed (and it works when only 2.0 or only 4.0 is installed). Because the problem does not reproduce elsewhere, we have to ask you to do the testing. Thank you for understanding.
           | Posted: 22 June 2012 at 1:43pm | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | kmeli Newbie
 
  
 
 Joined: 09 April 2012
 Location: United States
 Online Status: Offline
 Posts: 5
 | 
          When we try to install the update we only have 2 options,  Install objects for .net 2.0\3.0\3.4\4.0 + winforms and asp.net samples
           | Posted: 23 June 2012 at 11:49am | IP Logged |   |  
           | 
 |  Or object assembly optimized for .net 4.0
 There is no option for only 2.0
 Thank you
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          when you leave 4 .0 option unchecked, 2.0 version gets installed. of course, it can work with .net 4.0 as well.
           | Posted: 23 June 2012 at 5:13pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | kmeli Newbie
 
  
 
 Joined: 09 April 2012
 Location: United States
 Online Status: Offline
 Posts: 5
 | 
          WIth .net 40 I get the following error
           | Posted: 25 June 2012 at 5:21am | IP Logged |   |  
           | 
 |  I attemped to use the MailBee.NET.4.dll file again... and I receive the following error:
 [6/24/2012 2:15:38 PM] Jeff Slapp: Attempt by security transparent method 'a.b.an.a(Int32)' to call native code through method 'a.b.an.FormatMessage(Int32, IntPtr, Int32, Int32, IntPtr ByRef, Int32, IntPtr)' failed.  Methods must be security critical or security safe-critical to call native code.
 
 at a.b.an.a(Int32 A_0)
 at MailBee.MailBeeLoginWin32Exception.a(Int32 A_0, Int32 A_1)
 at MailBee.MailBeeLoginWin32Exception..ctor(Int32 A_0)
 at a.a.a.a(Byte[] A_0, Int32 A_1, Int32 A_2)
 at System.Net.StreamFramer.WriteMessage(Byte[] message)
 at System.Net.Security.NegoState.StartSendAuthResetSignal(LazyAsyncResult lazyResult, Byte[] message, Exception exception)
 at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
 at System.Net.Security.NegoState.CheckCompletionBeforeNextSend(Byte[] message, LazyAsyncResult lazyResult)
 at System.Net.Security.NegoState.ProcessReceivedBlob(Byte[] message, LazyAsyncResult lazyResult)
 at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
 at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
 at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
 at a.a.h()
 at a.t.a(SaslMethod A_0, String A_1, String A_2, String A_3, String A_4, String A_5)
 at a.t.a(AuthenticationMethods A_0, AuthenticationMethods A_1, SaslMethod A_2, AuthenticationOptions A_3, String A_4, String A_5, String A_6, String A_7)
 at a.w.a(AuthenticationMethods A_0, AuthenticationMethods A_1, SaslMethod A_2, AuthenticationOptions A_3, String A_4, String A_5, String A_6, String A_7)
 at a.w.d()
 at a.ax.a(Boolean A_0, String A_1, String A_2, String A_3, String A_4, AuthenticationMethods A_5, AuthenticationOptions A_6, SaslMethod A_7)
 at a.ax.d(Boolean A_0, String A_1, String A_2)
 at TLSContractProcessor.MailHandler.LoginToIMAP()
 The .net 2.0 works
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Does this problem only occurs when you're making SSL connection? Or, even regular non-SSL connection fails too?
           | Posted: 25 June 2012 at 6:13am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Also, does it help if you set this in your app.config?
           | Posted: 25 June 2012 at 6:16am | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | <configuration>
 <runtime>
 <NetFx40_LegacySecurityPolicy enabled="true" />
 </runtime>
 </configuration>
 
 |  |  |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          One more question. If you run the code under an interactive user (console application), not windows service user or ASP.NET, does it work?
           | Posted: 25 June 2012 at 6:57am | IP Logged |   |  
           | 
 |  
 In our tests, 4.0 version is working fine with SSL.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Also, are you using some kind of your own DLL, or are you accessing MailBee directly from your core application? If you're accessing MailBee through your .DLL, does it contain AllowPartiallyTrustedCallers attribute? Or, maybe, your code sets some specific security demands or something like that?
           | Posted: 25 June 2012 at 7:59am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Anonse Newbie
 
  
  
 Joined: 21 January 2013
 Location: Poland
 Online Status: Offline
 Posts: 1
 | 
          I had a similar problem as Kmeli, reinstalled with .net 2.0-only version and everything's ok now. Thanks for the tips
           | Posted: 21 January 2013 at 11:21pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |       | 
       
       
        |  |