.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

.Net Remoting multi threading issue

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF


I have a Windows service running on the server. It allows client workstations access it via .Net remoting. The Server service is simply a gateway to the database. Clients call methods on the Server class via remoting to make database calls (Selects, Inserts etc.).

During load testing we've observed the calls to the server take longer when multiple clients make simultaneous requests. The analysis indicates the requests are actually getting queued up. If 2 clients call the same method on the Server object, the two requests are processed in sequence. We have tried both Singleton and Singlecall. Same results.

Is there a bug in .Net remoting that it cannot process simultaneous client requests? If yes, is there a workaround (a quick one)?

We are using .Net 2.0 and are willing to switch to a higher version if the bug has been resolved in 3.0 or 4.0.



View Complete Post

More Related Resource Links

Multi-threading in .NET: Introduction and suggestions

This article uses the C# type shorthands throughout - int for Int32 etc. I hope this makes it easier for C# developers to read, and won't impede any other developers too much. It also only talks about the C# ways of declaring variables to be volatile and locking monitors. Developers using other languages can find the equivalents in their own preferred environment, I'm sure.

Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

asp.net c# DELEGATE THREAD: Multi threading



In my asp.net web application i have lengthy excution process like word merge. I want to merge the word documents and send to client in a procedure. Basically i am looking for run and forget kind of asynchronous process.

In my for loop i tried to create delegate and rstrat. like this

filenames is a string array, creating in the same loop and assiging values before calling delegate.


MailSender mail = new MailSender();



TestDelegate testdele = new

Issue with multi-valued crawled property

Hi, The problem is, we have a multi-valued crawled property (Managed Metadata type) which we are mapping to a managed property. The managed property has been created, setting MergeCrawledProperties to false.   On the page http://technet.microsoft.com/en-us/library/ff393811.aspx , it states that if MergeCrawledProperties is not set, only the first element is stored in the managed property. We are seeing this behaviour in our environment.   That is causing an issue with refinement results based on this managed property, because it is not including the second element as a result. For example, if we crawl the following content:   Doc1.doc           Property1;Property2 Doc2.doc           Property1;Property2 Doc3.doc           Property2   Refinement results look like this: Property 1           RefinementCount = 2 Property 2           RefinementCount = 1   Ideally we would like to see Property 2’s RefinementCount = 3 to accurately reflect our source data.   We also tried setting MergeCrawledProperties to true , however this merges results together.   For example, with our scenario above, refi

WPF Threading issue with Win32 Container

We are trying to integrate existing WPF window on to Win32 container application. The win32 application can integrate and show only Winforms Usercontrols. Since we already have a running WPF window code, we used windows forms usercontrol , element host and the content presenter of the window inside the element host to show in winforms usercontrol.The WPF window code overrides the function protected virtual void OnInitialized(EventArgs e) and calls first base.OnInitialized and then the custom code. The issue is here is that you can run the below code for the first instance from win32 container , but second instance when we execute same code , it  throws the error "The calling thread cannot access this object because a different thread owns it." from the line  base.OnInitialized when initializing AutoUpdate window = new Autoupdate(); Even if we use the below code under dispatcher it throws the same error after the firstime.            ElementHost elementHost = new ElementHost();                         elementHost.Dock = DockStyle.None;                         element

Multi Tenant - User Profile Sync Issue




I ahve the user profile setup in partition mode. Every thin appears to be installed fine and running. On the main central admin page it list mulitple tenants. I have to seperate subscriptions setup with the following commands

Add-SPSiteSubscriptionProfileConfig -Identity $sub1 -ProfileServiceApplicationProxy $pUPSP -SynchronizationOU $ou -mysitehostlocation $mysiteurl

The subscription also has a featurepack and userauthenticationpath set


I recive the foloing erro when the MOS FIM connector tryes to export any user profiles

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Specified cast is not valid.
   at Microsoft.Office.Server.UserProfiles.ProfileChangeData.GetPartitionId(UserProfileApplicationProxy upaProxy)
   at Microsoft.Office.Server.UserProfiles.ProfileImportExportService.UpdateWithProfileChangeData(Int64 importExportId, ProfileChangeData[] profileChangeData)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,

multi targeting in VS2010: .NET 4 vs 2/3.5 serialization issue


in our team, we develop a  client/server application where the data (custom poco classes) get serialized and compressed and sent via WCF between server and client.
The data objects are always put in our custom IList<T> before beeing serialized (BinaryFormatter). Tthus, the list itself is going to be serialized/deserialized.
We have actually 2 implementations of IList<T>:
a)'PocoList<T>' which implements IListSource and IList<T>. The serialization is done in this class.
b)'PocoBindingList<T>' which implements IBindingList, IList and IList<T>. The main idea is to bind this list with the controls in the client.
So all pocos and these lists are implemented in a 'common' project shared by both solutions.

As long as we were using .NET 3.5 in server and 2.0 in client, it went fine.
Yesterday, we upgraded the Server projects from .NET 3.5 to .NET 4. The client solution is still targeted to .NET 2.0. We are working in VS2010 in both solutions.

Now I get in client the following exception which occurs in the Deserialize method of the BinaryFormatter:
 var serializer = new BinaryFormatter();
 object deserializedObject = serializer.Deserialize(dataStream);

Exception has been thrown by the target of an invocation.


Threading issue with TrackingParticipant


I have implemented a SynchronizationContext so my workflow are always call on the caller thread, even if not using the WorkflowInvoker. This way, I can be called in the Completed delegate and do some actions in the current Thread. But when I add a TrackingParticipant, the completed Handler isn't called on the caller thread like I expected...

Here is a sample to reproduce the sample with the threading culture (in my real scenario, I need something more important than culture...).

using System;
using System.Activities;
using System.Activities.Statements;
using System.Activities.Tracking;
using System.Diagnostics;
using System.Threading;

namespace ConsoleApplication5
  class Program
   static void Main (string[] args)
     const string ExpectedCultureName = "en-CA";

     Debug.Assert (System.Threading.Thread.CurrentThread.

Multi Threading



I have a DLL in which there are classes and classes have numerous methods.

I want to create 10 different instances of the DLL and pass a same variable to each of the instances. Every instance will loop through the same classes and same methods.

I want to use multi-threading for this purpose such that I can parallelly/simultaneously using all the 10 instances.


How do I go about it.


Detailed Explanation


I have 10 databases which store data about the Project Plans. my aim is to generate an XML file containg info about the plans. There is a variable that passes the name of the database to the DLL.

Now I want to use multi-threading such that I can generate files from all the databases simultaneously/parallely.

Note: I want to use the same variable to pass the name of the database to every instance.

 All the instances will use the same classes and methods for this purpose.


Thnx in advance.

Issue with SSRS multi-parameter control


Hi Folks,

I am having the attached error with a multi-parameter filter control. This is happening only when there is just 1 value in the list.

Has anyone come across this issue and is there a solution to this? I am using SSRS 2005.

Sorry was trying to attached a snap-shot here but don't know if thats possible.

I'll try yo put the issue in words. The list box does not show the item in it. It does not render fully.



Issue with multi valued parameters in SSRS using Oracle data source


Hi All,

I have a dataset which is getting data from oracle datasource and my Dataset query expression is

="select To_Char(Time_Stamp,'Month') as Month, Node_Name as Device,Connection,MSNAME,Monitor,Avg as Average,Max as Maximum FROM OracleDataVW where ((monitor='X' and msname in ('Y')) or (MONITOR = 'CPU Utilization' AND MSNAME = 'utilization')) and TO_Char(Time_Stamp,'Mon YYYY') in  ('"+ Join(Parameters!Parameter1.Value,",") +"')"

My parameter is multiValued parameter. The above query is working good if i select one value,however if select more than one value or all it is not giving me the data. I tried to put Ltrim and Rtrim in Join but it is giving me another syntax error.

Please help me with this

multi-language issue in mvc - soliving with routes / need a constraint !!


hi guys,

I am creating a multi language website with asp.net mvc 2.0

I tried to solve the problem with routes and I guess it will work just fine but I need some constraint inside my route;

here is my routes;

I have two routes;

                    new { controller = "Blogs", action = "Index" },
                    new { Id = @"\d+" }

                "Default", // Route name
                "{language}/{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", language = "tr", id = UrlParameter.Optional } // Parameter defaults

in 1st route, I do not need the language so it will pass without language. I am only excepting integer on this route as you could see on the id constraint.

what I need is that;

  • in the 2nd route, I need a constraint that specify language variable only can be en or tr. how can I write that?

thanks !

What is the advantage of Parallel Processing(Programming) aganist Multi threading

we are already getting parallel processing from w2k8 and the underlying intel processors evidenced by running an application on a single purpose machine and it showing all cores having equal usage Then why do we go for Parallel Programming in vs 2010?

Remoting Issue - Authentication Type changes from Kerberos to NTLM in Thread.CurrentPrincipal.Identi


Am facing followingproblem, Authentication Type changes from Kerberos to NTLM in Thread.CurrentPrincipal.Identity where as the user name comes properly while calling the method of service2 through remoting from service1.

Actually the problem scenario is as follows, from client am making calls to service1 and from the service1 am making the call to another service2 where the problem occurs.

             Kerberos                              NTML
Client ----------------> Server1 -------------------------> another service2
         remoting call                      remoting call

But When I made the remoting call from the client directly to service2, am getting the security type as Kerberos properly.

Please advise.

Am running out of time, looking for you valuable comments...!!!



Is SQL Compact Edition save to use in ASP.NET Web Apps - Multi-Threading?


I have a question:


Is SQL Compact Edition safe to use in ASP.NET WebApps?


And second if so, should i use transation isolation level or row locking hints to assure data quality during iniserts?


E.g. i want to assure that there is only one record named user2@domain2 and thus i want to make sure that my code

will not fail in a mutli-theaded scenario and insert second one or get a key exception back: see sample 


transaction or locking hit{

  select from users ....

  if no user found

  insert into users





Hello World to C# Threading Part 1

In this post we will see how we can implement simple threading. Why do we need threading? When you want you application to do more then one thing at same time, then you need to implement threading. One usual and common scenario would be when your application needs to get data from some other resource like web services and you don't want you application GUI to be freeze during this time. In that sort of case you will run the code to access web services in separate thread so your application GUI won't freeze. The System.Threading namespace .NET provide interfaces to implement multi threading.

Threading in C#

What is Threading?
-Parallel execution of code pieces on CPU, commonly compiled codes started in a single thread but it is possible to create multi-threads within a program.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend