Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug in VS 2013?
Message
De
04/05/2014 03:21:25
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01599384
Message ID:
01599513
Vues:
40
This message has been marked as a message which has helped to the initial question of the thread.
>>I see the Request class implements IDisposable so it's presumably accessing unmanaged resources - and the above code doesn't guarantee that Dispose() is called. Might just be possible that it's holding something open that the compiler needs. IAC you should wrap it in a using block.
>
>Viv,
>
>Can you clarify how should I apply using to that code?
>
>Thanks again.

Maybe:
public static string Invoke(string input)
        {
            using (CurrentRequest = new Request())
            {
                //........
             }
        }
But ideally the class containing this method should probably implement IDisposable and call Request.Dispose() there.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform