Previous | Index | Next 

[PRB] The migrated application takes too long at loading its first form

In general, a .NET application may take longer than a VB6 application at loading its first form. The main cause for this behavior is the JIT-compilation that is necessary to transform the application’s assembly (and all Windows Forms-related assemblies) into native CPU opcodes. You can solve this problem by means of the NGEN utility, as described in this knowledge base article.

A less common cause for this problem occurs when all the following conditions are met:

  • Your application uses one or more 3rd-party controls
  • These 3rd-party controls require code-sign verification
  • The computer doesn’t have Internet connection

In the above scenario, the first time a control is loaded, the .NET CLR attempts to verify that the certificate used to sign the control’s assembly hasn’t been revoked. This operation requires a working Internet connection, and if this connection is missing then the application apparently freezes for 1 or 2 minutes, until the attempt times out.

Notice that this delay occurs even if the first form doesn’t contain any 3rd-party control, because any .NET project migrated with VB Migration Partner always scans its startup folder looking for additional assemblies. During this scan all the assemblies in the folder are loaded, an operation that fires the code-sign verification attempt.

Even more confusing is the fact that the delay occurs even if the application’s folder contains one or more 3rd-party controls, even if the application doesn’t use any of them. In fact, migrated .NET apps scan the startup folder in all cases and doesn’t make any distinction between controls that are actually used or assemblies that just happen to be stored in the application’s startup folder.

This behavior is common to all .NET applications – either migrated from VB6 or written from scratch – and is fully described in this article from ComponentOne knowdlege base.  Towards the end of this article you can also find the two available solutions to this problem:

  • You ask the control’s vendor to provide you with a version of the control that doesn’t require code-sign verification
Or
  • You disable the “Check for publisher’s certificate revocation” option, in the Advanced tab of the Internet Options dialog that you can bring up from Windows Control Panel.

 

Previous | Index | Next