Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom MSBuild Task throws ObjectDisposedException when making a HttpWebRequest
    text
    copied!<p>I am trying to write a custom msbuild task that checks a if a website is available. But when my task end it throws a ObjectDisposedException with the following stack trace.</p> <pre><code> at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean&amp; success) at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean&amp; success) at Microsoft.Win32.Win32Native.SetEvent(SafeWaitHandle handle) at System.Threading.EventWaitHandle.Set() at Microsoft.Build.Utilities.ToolTask.ReceiveStandardErrorOrOutputData(DataReceivedEventArgs e, Queue dataQueue, ManualResetEvent dataAvailableSignal) at Microsoft.Build.Utilities.ToolTask.ReceiveStandardOutputData(Object sender, DataReceivedEventArgs e) at System.Diagnostics.Process.OutputReadNotifyUser(String data) at System.Diagnostics.AsyncStreamReader.FlushMessageQueue() at System.Diagnostics.AsyncStreamReader.GetLinesFromStringBuilder() at System.Diagnostics.AsyncStreamReader.ReadBuffer(IAsyncResult ar) at System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage msg) at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall() at System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object o) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() </code></pre> <p>I don't understand what is causing this behavior. </p> <p>Here is the simplest code snippet that shows the problem.</p> <pre><code>public class CustomTask : Task { public override bool Execute() { Thread.Sleep(10000); return true; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload