When migrating ASP applications to ASP.NET, you should be aware of the potential performance issues associated with the following subjects:
Calls to unmanaged codeВ В В Managed-code calls to unmanaged components incur a marshaling cost and can noticeably affect performance. For best performance, COM components should be rewritten in managed code using a runtime-compatible language. If this is not possible, try reducing the number of calls between the managed and unmanaged boundary, with your code doing more work between calls. For more information, see .
Late bindingВ В В ASP used the method to create an object of indeterminate type, as shown in the following example:
В Copy Code
SampleObject = Server.CreateObject("ProgId")
This type of declaration works with ASP.NET, but for best performance, the type of object should be declared when it is created:
Visual BasicВ Copy Code
Dim SampleObject As New ObjectType() ' or ' Dim SampleObject As ObjectType = New ObjectType()
C#В Copy Code
ObjectType SampleObject = new ObjectType();
Note that you must use the Tlbimp.exe utility in order to import the type into your page before declaring early-bound COM objects.