|
If you look at the member documentation in the .NET Framework SDK, several methods should be obvious, like GetProcessByName :
Process[] procs = Process.GetProcessesByName("notepad");
if (procs != null)
foreach (Process proc in procs)
proc.Kill(); Please note it's not always such a good idea to kill processes, though. First try to close them gracefully using Process.CloseMainWindow followed by Process.Close . If that doesn't work or if you really mean to kill processes, then use Process.Kill .
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
check
http://www.codeproject.com/csharp/cskillapp.asp
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
|
Colin Angus Mackay wrote:
Won't anyone think of the clicketies!
Haven't you started that fund yet? SaveTheClickities.org?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am just doing a bit of load testing of a web service. I wrote several test cases in NUNIT to fire off.
One test case creates several (5) threads which all start close to each other and call the web service several times. For some reason, usually only one (sometimes 2) of the threads complete, the others seem to hang. It is also never the same thread that completes.
Does anyone have a clue why this may be the case?
tia
stephan
|
|
|
|
|
Maybe the Web Service isn't mutli-threaded...
|
|
|
|
|
Wininet.dll limits connections to an HTTP 1.0 server to 4 and to an HTTP 1.1 server to 2. See http://support.microsoft.com/default.aspx?scid=kb;en-us;320721[^] for details.
Similarily, the ServierPointManager is configured to, by default, limit connections to a particular server to 2. You can change this by setting ServicePointManager.DefaultConnectionLimit to something higher, or use HttpWebRequest.ServicePoint to get the ServicePoint for a particular web address and set ServicePoint.ConnectionLimit to something higher than 2. This should apply to all connections made to a particular server.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Maybe I am missing it - but I am not connecting from IE.
This is a class dll that is running under nunit doing web service calls. it does so by creating multiple threads that all hit the same web service.
Basically some threads simply stop and never return;
Stephan
|
|
|
|
|
A WebService request is nothing but a glorified page request over HTTP or HTTPS. So, yes, your using the very same WinInet.dll that IE uses to execute and download its page requests and everything in that article applies to your problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Actually, the .NET BCL doesn't use wininet.dll. That's why I explained about the ServicePoint and ServicePointManager . It's the same situation under different APIs, but the KB article explains the "why" a little better than in the .NET documentation (which doesn't even state what the default connection limit is initially set to - you have to dig into the IL - which you know I love - to find that).
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
In .NET HTTP requests are made via HttpWebRequest (well, typically). This uses ServicePoint s and a ServiePointManager to manage connections to servers.
Why I explained this with wininet.dll and gave you a link is because it contains more information about why. The .NET Framework SDK documentation isn't clear on a default, so you have to dig into the IL intructions and type metadata in the assembly to know this information (which I do all the time).
A web service proxy (client) uses HttpWebRequest internally and thus is prone to the same conditions that I described in my post.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks for the info. I will check this out. At least it appears the problem is with my test code and not with the app I was testing.
Stephan
|
|
|
|
|
This did indeed fix the problem. However it does raise a question. Currently, when the number of threads trying to open simulatneous connections to the service exceed the limit, these threads go into WaitSleepJoin state. So far so good. But when the other threads close their connections, shouldn't these threads be activated by the system? At the moment the threads stay in their suspended state until they get killed by the main process (if they are background threads).
Is this a bug or a feature?
|
|
|
|
|
Looks like they're not being signals, but without digging into the IL (and sorry to say, but it's lunch time here ) I can't know what the problem is for sure. So I encourage you to do it. If you don't know IL and how t use ildasm.exe in the SDK, it's a great learning experience and can teach you much more about .NET than just reading docs or books.
It's likely there's a bug, but don't consider it as such until you've investigated it. If I get a chance later I will look into it.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I have started digging around a bit starting with ServicePoint and SoapRequest. However it looks like there is quite some way to go until I'd come to the point where the threads actually are being put to sleep. I suspect it would happen somewhere in the HTTPRequest class. you might be able to shortcut this as to where in the .NET space the dispatching (and supposedly putting to sleep) is likely to occur.
Unfortunately there is this thing called work getting in the way.
Cheers
Stephan
|
|
|
|
|
Using the WROX press edition of Beginning asp.net databases using C#.
My system is XP pro and i have IIS installed.i have followed the instructions in the text book to obtain and install MSDE, the Microsoft SQL server desktop engine installed no prob, and so to the samples.
In chapter 12 of this book there is a working example of a auction site, which i would like to copy and re-write myself.
I downloaded the example from the wrox site, and followed the instructions to setup this auction site. However i am given the error msg from the log file of the setup
Configuarion complete with errors view setup.log
which then gives this:
25/08/2004 16:40:57: : Configuration started
25/08/2004 16:40:57: [Pass] : Virtual root deleted: bid
25/08/2004 16:40:57: [Pass] : Virtual root added at bid
25/08/2004 16:40:57: [Fail] : Failure installing database 'bid' : Object reference not set to an instance of an object.
25/08/2004 16:40:57: : Configuration complete
when i try to write an asp.net web application using visual studio, i also get the error:
The web server reported the following error when attempting to create or open the web project located at the following URL: "http://localhost/webapplication1. "http://1.1 500 internal server error
http://localhost/webapplication1
i also have problems in visual studio gettin access to the northwind database.
If you can help me, gimme a email pls. i am sure i am just missing one piece of the jigsaw, then i can make my asp.net web page work
|
|
|
|
|
This question really belongs in the ASP.NET[^] forum, but my first question is IIS running? A server error of 500 could mean it can't contact IIS.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Indeed this question is in asp.net forum, but i am struggling, so i put it in here too.
IIS is located under admin tools, my computer name is there is that all i need to see.
Miles
|
|
|
|
|
I always view IIS through the Microsoft Management Console (type mmc from the Run dialog), from their you can create your own view with the snap-in's. You can see that IIS is running at the top there is a arrow pointing to the right, greyed out. Look at this: IIS image[^].
- Nick Parker My Blog | My Articles
|
|
|
|
|
ok, i've been to IIS in admin, and INETPUB has an error.
It says the system cannot find the file specified.
|
|
|
|
|
Miles Roberts wrote:
It says the system cannot find the file specified.
I would assume the file doesn't exist then?
- Nick Parker My Blog | My Articles
|
|
|
|
|
its there now, for some reason i moved it too shared documents folder, now its in the c: drive folder.
When i type http://milo-q4tm929ggw/localstart.asp, its gives me the IIS page, should i follow the instructions to get these sample asp pages working for me. Once i have them up, my actually programming isnt that bad and i can get a working website.
Whats me next stage chief?
|
|
|
|
|
|
ok cheers i will do that! i'll contact u if i have any problems.
Miles
|
|
|
|
|
Just because you see IIS under Administrative Tools doesn't mean it's running. That's only an MMC snap-in to configure IIS. The best way is to open it and see if the site is running (try it out and explore).
The problem you're getting is probably because there's an error in your code. When you're connecting to the ASP.NET web site running in IIS (default behavior) a web application is instantiate (an AppDomain is created for it) and your code is JIT'd and executed. Any errors may return HTTP 500 (or others, depending on the problem).
The first thing you should do is point your web browser at the same URL you're trying to access from VS.NET (I'm assuming you're working with Web Services by the sound of it). That should give you more information.
If not, edit your Web.config file in either the virtual host root directory (resolves to /, default is C:\Inetpub\wwwroot) that contains settings for every web application under it, or a specific web application's Web.config file (a web application is a virtual directory with an app created on it in IIS - it has a different icon, to be frank).
Add <customErrors mode="Off"/> under <system.web> if it isn't added already. It should be there by default (VS.NET has it in the template for Web.config), so just edit the mode attribute in case.
I also urge you to read the .NET Framework SDK and not just that book. Books may teach you concepts but it's important to understand the technical details as well, such as AppDomains and how ASP.NET works within IIS. It's all in the .NET Framework SDK.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|