|
I am trying to put common configuration settings for 4 applications in a common configuration file.
I have used the
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<linkedConfiguration href="file://E:\Projects\ABC\SOURCE\ABC_SOLUTION\common.config"/>
</assemblyBinding>
in all 4 app.config files so that the settings made there are available.
From each of the application I have used
System.Configuration.ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString
to read the connection string from the common config file.
I get null. Please help.
Thanks in advance.
|
|
|
|
|
When i m Building My ASP .NET application on VS 2005 it works fine i mean it generates the DLL after compilation but ..while compiling the asp .NEt solution file using nant builder it wont generates the required DLL ...
Can anyone will tell me how to run ASP .NET application using NANT script.
Ihave nant-0.85 and web deployement project installed on my PC......
But I dont know how to compile asp net sln file in nant using ASPNET_compiler.exe
I m using the following command in nant builder that doesnt work:
exec program="${dotnet}/aspnet_compiler.exe"
commandline=" -v /abcd.sln -p E:\slnabcd c:\tk1"
aaa
|
|
|
|
|
Please don't cross post. You asked this same question in the Web Development[^] forum.
|
|
|
|
|
Now i have a problem to search pdl(group) in the ldap server, i can search the pdl(group) with the following filter
string filter = "(&(objectClass=group)(displayname=" + displayname + "))"
but can only filter out with the whole display name
if i want to search with partial name, what should i do??
|
|
|
|
|
My LDAP is a little rusty, but IIRC it's:
(&(objectClass=group)(displayName=SomeNa*))
|
|
|
|
|
|
-- modified at 8:59 Thursday 11th October, 2007
i want to create web server that have video(realtime)
and i dont know that how to do.
i saw msn can display video(realtime) from client to client.
you can help me
|
|
|
|
|
You're going to have to be much more specific about what you want to do. Are you thinking of writing the video server or some client to show the video or both?
|
|
|
|
|
Using something along the lines of the following:
XslCompiledTransform transform = new XslCompiledTransform();
transform.Load(Constants.XSLTFile);
using (XmlReader reader = XmlReader.Create(new System.IO.StringReader(sb.ToString())))
{
using (TextWriter textWriter = new StreamWriter(Constants.OutputFile, false, Encoding.GetEncoding("Windows-1252")))
{
transform.Transform(reader, null, textWriter);
}
}
The goal here is to create a text file from XML using XSLT. For auditing purposes need to know how many rows being written to the text file after the tranformation.
All help is appreciated.
Regards,
Boris
|
|
|
|
|
You could create a class that derives from StreamWriter[^], then override the appropriate Write methods. In your overrides, you would check for the TextWriter.NewLine chars.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I have a quad core machine, how many threads can an application domain handle?
How can I determine the capabilities of the machine at runtime to know how many buckets, and threads I can/should use?
|
|
|
|
|
steve_a_p wrote: how many threads can an application domain handle?
I don't know but I would guess it is more than you would want to use. Does that help?
steve_a_p wrote: How can I determine the capabilities of the machine at runtime to know how many buckets, and threads I can/should use?
So you believe the point of interest to your situation is knowing the maximum number of threads that your environment will allow you to allocate?
|
|
|
|
|
Hi,
Environment.ProcessorCount could be useful.
Having lots of threads that (try to) do similar things is not helping since all these
threads will compete for the same resources (either CPU cycles, cache hits, memory bandwidth,
whatever). So I would not exceed twice the processor count for identical threads.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: So I would not exceed twice the processor count for identical threads.
So ProcessorCount * 2 formula... that's good. Now do you have a citation for that?
|
|
|
|
|
Thank you for the information. The optimal number of threads equals the number of processors on a system and it shouldn't exceed twice the processor count. Correct? Why not 3 times?
|
|
|
|
|
steve_a_p wrote: Thank you for the information. The optimal number of threads equals the number of processors on a system and it shouldn't exceed twice the processor count. Correct? Why not 3 times?
See my other reply in this thread.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
The main message is it is not tens of threads: just adding more and more threads will
increase the overhead and not reduce the overall execution time. And it does depend on
the thread function: if it is pure computation, one thread per processor will do;
if there is I/O latency involved, two per processor will be better (and more typically
does not help due to I/O limitations); if it is a pure Sleep() you can have as many as
you want.
The good thing is if you organize things around Environment.ProcessorCount:
1. you can try another factor and observe what it brings you.
2. your app is less likely to suddenly behave badly when you move it to a system with
a different processor count (which may well happen when you fix the number of threads).
And as Patrick pointed out, you are not completely in charge:
1. with .NET you will not (easily) control which thread runs on which processor;
2. other apps and services will be running too.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
Can I just say, this entire discussion in the context of the .NET Framework is a waste of time. The Framework provides no control over where those threads are going to execute, nor do they provide synchronization capabilities across processor cores.
The only limit on the number of threads you can actually create is the limit of the addressable memory space on the machine.
If you really need a parallelized application, the .NET Framework is not the platform to use. If you need this, you should be using something like MPI, OpenMP, or a newer solution by Intel called Threading Building Blocks (http://osstbb.intel.com/[^]) which is aware not only of separate processors, but distinct processor cores.
So far as I am aware, there are no .NET wrappers for those libraries. You'd be using C/C++.
Once you get to those libraries, a question of how many threads to use becomes heavily dependent on what each thread is doing and the overall architecture of a parallelized application.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
Yeah, it is not perfect, but my main objective was to warn against too many threads;
some people seem to expect performance increases linearly with the number of threads,
which obviously is not true at all.
So for a single processor I often give the following approach:
"as a first approximation, this is what you could do: write and run the code to use a
single thread; observe the CPU load (with Task Manager) as a percentage.
The inverse number is the number of threads you want, so if it is close to 100% extra
threads won't bring you anything; if it is near 25% using four threads MIGHT
increase the performance by four, bringing the CPU load to 100%. More threads
than that won't help you."
And one should not forget the obvious approach to increasing performance, is by optimizing
the application at all levels: algorithms, data structures, coding, compiler settings, etc.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
So just because a better threading lib exists in C one shouldn't use threading in .NET? Weird logic. I've used multithreading in dozens of situations in .NET and although it is not "aware" of the number of physical processors/cores it generally does a good job. Why? Because the operating system takes care of it.
|
|
|
|
|
Robert Rohde wrote: So just because a better threading lib exists in C one shouldn't use threading in .NET? Weird logic. I've used multithreading in dozens of situations in .NET and although it is not "aware" of the number of physical processors/cores it generally does a good job. Why? Because the operating system takes care of it.
Of course not. I was responding specifically in the context of counting threads based on the number of processors you have. That's pointless in .NET.
Yes, the OS will do some thread parallelization for you, but if you actively want to use those processors you have to use lower level languages with specialized libraries.
There's nothing wrong with threading, but you have to understand your problem and the limitations of various solutions before you start creating tons of threads thinking it will solve your problem, as Luc accurately points out.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|
|
Patrick Sears wrote: I was responding specifically in the context of counting threads based on the number of processors you have. That's pointless in .NET.
Not totally. I agree that you cannot be 100% sure that if you run 4 threads in .NET that every thread will run on its own core (although it does it very often). Nevertheless you have a "hint" on how many parellel threads might be good. If you know you have only one core than you would normally not start several threads (assumming its only about number crunching).
But I agree with your other points.
Robert
|
|
|
|
|
Robert Rohde wrote: Not totally. I agree that you cannot be 100% sure that if you run 4 threads in .NET that every thread will run on its own core (although it does it very often). Nevertheless you have a "hint" on how many parellel threads might be good. If you know you have only one core than you would normally not start several threads (assumming its only about number crunching).
And I also agree with you there
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
|
|
|
|