Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Implementing IDisposable in a class
Message
De
12/02/2014 11:15:49
 
 
À
12/02/2014 09:56:45
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01594093
Message ID:
01594167
Vues:
30
>>Your SOAPSVC class implements IDisposable but does nothing on Dispose(). Based on your current code it should call oOperationContextScope.Dispose() - I don't see how you can implement Using here:
>>loSOAPSVC.oOperationContextScope = New System.ServiceModel.OperationContextScope(loMyService.InnerChannel)
>>
>>See: http://msdn.microsoft.com/en-us/library/ms244737.aspx on the correct pattern for Dispose()
>
>I did it by implementing a ghost reference to the class:
>
>
>                            Using oOperationContextScope = New System.ServiceModel.OperationContextScope(loClaimService.InnerChannel)
>                                loSOAPSVC.oOperationContextScope = oOperationContextScope
>
>
>Once the local object goes away, so will be the referenced object.

Don't think you need to oOperationContextScope:
Using loSOAPSVC.oOperationContextScope  = New System.ServiceModel.OperationContextScope(loClaimService.InnerChannel)


>But, it might be simpler to have this one in the Dispose() instead of using that approach.
>
>Thanks for the mentioned point about it, I will give it a try.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform