C# - "Thread Was Being Aborted" In WCF Service Call?
Sep 28, 2010
In my program there is a aspx page that contains wcf client, that so on calls wcf service located on same server.
I`v get this exception when my wcf client calls wcf service hosted in IIS on production server.
Ex. msg: Thread was being aborted.
Ex stack: at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags)
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) [code]...
I using PRTG Ipmonitor and it give me too many requests on "Requests Current" sensor.My site become anavailable in browser.If a delete this page that calls service all is gona be OK.
View 2 Replies
Similar Messages:
Oct 27, 2010
I run a loop that downloads a lot of smal files from another website
try
Loopstarts
result = runData()
loop ends
catch ex1 as exception
End try
private function runData() as string
Dim wc as new WebClient
Dim str as string
try
str = wc.downloadstring(filePath)
catch ex2 as exception
return "Nothing"
end try
wc.dispose()
finally
return str
end function
THE Problem is if the file is not found in the RunData function I get 'Thread being aborted' error which stops the not only the function RunData() but also the loop is running in, so I get an error in ex2 as well as ex1. But I want the error to be captured in ex1 and stop, and not effect the loop.
I have read that you need to use Response.End to close the thread or not to capture the 'threadbeingaborted' expception.
BUT how do you do the response.end with a webclient??? (IN vb.net , asp.net 2.0 version
View 2 Replies
Sep 8, 2010
[code]...
test in VS 2010 Professional and ASP.NET development Server no error.but in Server 2003 and IIS 6 show error:Server Error in '/' Application.Thread was being aborted.Description:An unhandled exception occurred during the execution of the current web request.Please review the stack trace for more information about the error and where it originated in the code.Exception Details:System.Threading.ThreadAbortException:Thread was being aborted.
Source Error:An unhandled exception was generated during the execution of the current web request.Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:[ThreadAbortException:Thread was being aborted.]
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously) +486
[code]...
View 2 Replies
Sep 9, 2010
I am using web service method to run scripts it generated the some unwanted folders i want to delete folders after or before the script runs.
ProcessStatus newProcess =
new ProcessStatus(
String.Format(
"{0}, started:{1}",
projectName, DateTime.Now.ToString("HH:m:ss")
)
);
newProcess.buildData = new BuildHelper(deviceName, projectName, owner, deviceFolder, Constants.serverContentpath, Constants.buildInfoFilePath);
ProcessStatuses processStatus = new ProcessStatuses();
ArrayList allProcesses = processStatus.Get();
ArrayList.Synchronized(allProcesses).Add(newProcess);
ThreadPool.QueueUserWorkItem(
new WaitCallback(processStatus.startProcessing),
new object[] { newProcess, allProcesses }
);
//Thread th = new Thread(new ThreadStart(delegate {
// processStatus.startProcessing(new object[] { newProcess, allProcesses });
//}));
//th.Start();
processStatus = null;
newProcess = null;
_deviceBuildMonitor = null;
View 1 Replies
May 21, 2010
The following code is part of a WCF service. Will eventWatcher take up a thread in the ASP .NET thread pool, even if it is set IsBackground = true?
[code].....
View 1 Replies
Jan 20, 2011
I'm having the Thread was being aborted exception in this simple code, running on IIS 6 when i run a long query.
[Code]....
View 1 Replies
Feb 8, 2010
I have an ASPX page with several update panels. They all have their UpdateMode="Conditional".
Some panels are refreshed when the user clicks a button and other are refreshed regularly, with a timer.
The panel refreshed with a timer launches a database query and many validations on the data. Then display the result in a panel when errors have been found.
That all works fine except when the validation has to delete files on the disk. (.txt, .jpg, etc it depends). In that case, after the validation is made, I am always kicked out of my website because of the error (Thread was being aborted). So I loose all my session variables which means I am not logged off.
Anybody had that kind of problem ? Is it normal that deleting files AND directories on the server make me loose my session? Is there a way to prevent that ?
View 3 Replies
May 15, 2010
i have to do some message exchange with a 3rd party (in a website).When the client posts a page, i start the message exchange. When that doesn't succeed for some reason, i report this to the client by rendering the page with a message.On the background, in a separate thread, i start a process to send abort messages to the 3rd party. I can't do this while the user is waiting for the page to come back, because it might take a few minutes.But in a test project, the test ends when the message to the 3rd party is sent, and after the new thread is started. But it seems that the new thread also ends, when the test is done.
Is that normal behaviour?I do start the thread in a new class with a reference to 2 objects from the class which tries to send the message in the first place, may that be a problem?EDIT: it keeps running when the whole process is started in IIS
View 1 Replies
Feb 10, 2010
I have been using the RemotePost Class( as per http://www.jigar.net/articles/viewhtmlcontent78.aspx) to post a form to a pay provider, for about 3 months successfully, I made some changes external from the call to this class that sent an email when user presses the button to notify us that the user has selected to go through to the pay provider (similar to PayPal). and suddenly got an exception error MSCROLIB, Thread was being aborted. I have since removed the code and I still get the error it happens when I call
[Code]....
I tried the suggestion on KB article [URL]/ but the control is not past to the Pay Provider I also took the actual response that is written and posted it to a new html file added a submit button and it works. So I am no stuck. The Pay provider claims they have changed nothing, and has tried to help but says they are receiving no input from either our dev site or the live site.I also tried to step into the call but it just throughs the exception
View 4 Replies
Feb 7, 2010
System.Configuration.ConfigurationErrorsException - System.Web, Thread was being aborted.
(C:Inetpubweb.config line 417)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
[code]...
When it does the app needs to be restarted to clear the error, every page request after this raises the same bug. Line 417 is the Membrship provider add line in web.config. We're using the UpmMembershipProvider from MS Commerce Server, but it doesn't seem to be hitting this code, it's dying on the ConfigurationErrorsException inside System.Web.Security.Membership.Initializ
View 1 Replies
Sep 8, 2010
"Thread was being aborted" on IIS 6?c# code:
[Code]...
View 7 Replies
Apr 2, 2010
I want to remove checked items from checklistbox (winform control) in class file method which i am calling asynchronously using deletegate. but it showing me this error message:-
Cross-thread operation not valid: Control 'checkedListBox1' accessed from a thread other than the thread it was created on.
i have tried invoke required but again got the same error. Sample code is below:
[code]....
View 1 Replies
Dec 16, 2010
I have created thread pool which have 5 threads. Both of them will start when my application start up. The problem is I created so many objects in thread loop call back function on each threads, and the memory is increase by second when app running, this is thread loop call back function:
void ThreadLoop(){
while(true){
var checkItems = _workItems.Where(w=>w.ActivedTime > 3).ToList();
foreach(var i in checkItems){
_workItems[i.Id].ActivedTime = 0;
_workItems[i.Id].ExecutePostBack();
}
//Recreate new _workItems dictionary
_workItems = _workItems.Where(w=>w.ActivedTime > 0).ToDictionary();
// Sleep thread to free up momory
Thread.Sleep(1000);
// Call Grab collector free memory
GC.Collect();
}
}
I'm confusing that, is calling GC.Collect() on each threads like that good or bad ? Dose it cause bad performence ?
View 3 Replies
Oct 1, 2010
i am developing an online mmorpg game . so speed is very important . i have a complex map system which is coded by me . at this map system for walking i am using ajax . using iis 7.5 and netframework 3.5 .
at this page you can use w,a,s,d or keyboard arrow keys for walking [URL] ( username : test1234 , password : test1234 )
as you can see at image below when a player pushes the movement buttons faster ( without waiting to move completed ) status being aborted so it really prevents walking faster i want to prevent this is from happening ( disable buttons to be pushed so fast until post event completed )
[Code]....
[Code]....
View 2 Replies
Jul 7, 2010
I create a NetworkStream from a TCPClient, I then call BeginRead() followed by Thread.Sleep(60000).
It seems that the BeginRead call back function will only ever occur after Thread.Sleep() has completed. Is this expected behaviour?
What I was expecting was for the call back function to be carried out on a separate thread whenever it was ready and that the Thread.Sleep() on the current thread should have no affect on when/how the call back function runs...
I'm currently creating a VT100 terminal emulator, I wanted to created a method that would allow me to make the emulator sleep until a given string is found in the screen buffer. Initially I was trying to call WaitOne() on the IAsyncResult passed back from BeginRead() if the string was missing (this was to allow more data to pass into the system so that the check could then be carried out again until it was passed), after this failed I tried Thread.Sleep instead of WaitOne() but this blocked my BeginRead call back from firing and I'm now I'm starting to think everything is running from a single thread...
View 3 Replies
Mar 29, 2010
How to call Synchronous service call for combo boxes? As I know Synchronous calls do not create a good user experience because the application is hung waiting for the Web service call to return. Then it is my requirement.
View 1 Replies
May 18, 2010
whether its possible to call an web service on a private corporate network from a web service located in a dmz?
View 2 Replies
Aug 4, 2010
i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.
[Code]....
[Code]....
View 1 Replies
Jan 27, 2010
How can we debbug a multi-thread program to see local variables of each thread using visual studio 2008.
View 1 Replies
Nov 24, 2010
I'm new to threading and have used it successfully, but limited. I can spawn a thread and have the main thread reference variables in the spawned thread, but I don't know how to allow the spawned thread to reference (and update) variables in the main thread.
Any example threading code I've seen on the web appears to be WAY more complicated than what I do, so I am unable to understand or integrate into my code.
Here is a quick example of how I use threading:
[code].....
View 3 Replies
Mar 24, 2010
I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused.
# WindowsIdentity = WindowsIdentity.GetCurrent()
which returns the identity of the security context of the currently executing Win32 thread.
# Thread = Thread.CurrentPrincipal
which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.
View 1 Replies
Jun 25, 2010
I have a password page and when someone enters an incorrect password I want to simply foil a brute force attack by having
bool isGoodPassword = (password == expected_password);
lock (this)
{
if (!isGoodPassword)
Thread.Sleep(2000);
}
I would expect that this would allow all correct passwords without stalling, but if one user enters a bad password another successful password from a different user would also be blocked. However, the lock doesn't seem to lock across ASP.NET threads.
View 4 Replies
Aug 27, 2010
I want a example of multithreading .i want to use it in a web form not on console.i am using C#.net .and how to use thread.sleep method for a particular thread.
View 5 Replies
Feb 8, 2010
I need to call a Rest service but would like to do so without having to redirect. Here is my dilemma. The Rest service we are trying to integrate offers the option to sign up for a subscription but does not allow us to upgrade an existing subscription. So if a user wants to upgrade an existing subscription we have to first cancel and then have the user sign up for a brand new subscription. I don't know how I can make this so it flows nicely in my code. I ideally I would like to do something like this
User decides to upgrade
Click upgrade button
Existing account is being cancelled, if cancellation was successful
New account is being created
How can I do this with a Rest service? Here is a sample URI/URL
https://someservice.com?
Action=CancelSubscriptionAndRefund
&AWSAccessKeyId=AKIAIIFXJCFIHITREP4Q
&CallerReference=CallerReference07
&CancelReason=MyWish
&RefundAmount.CurrencyCode=USD
&RefundAmount.Value=1
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Signature=1uFUSSFvau1zadnSzKRS5ZchuLMn9p5M3ifaHGHie7M%3D
&SubscriptionId=17d62772-c53e-4bdb-9667-65d7b7841cfc
&Timestamp=2009-10-06T08%3A05%3A13.296Z
&Version=2008-09-
Could anybody give me some ideas how to make this work in an elegant manner. We thought we could keep the old subscription and then just sign the user up for a new subscription for the difference of the money. For example the first subscription would be 2.95 and the second one would be 2.00 which would amount to a subscription of 4.95. I think it is not elegant and the user would see 2 charges on the credit card, weird, I think. Since I don't know much about Rest maybe there is a way that this can be solved.
View 1 Replies
Feb 11, 2010
What does the using statement do? Is it actually needed?
using (MyWebservice x = new MyWebservice())
{
//random code
}
View 4 Replies