Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in VS 2013?
Message
From
04/05/2014 03:21:25
 
General information
Forum:
ASP.NET
Category:
Troubleshooting
Title:
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01599384
Message ID:
01599513
Views:
39
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform