Runtime: where is "System.Runtime.Remoting.Messaging.CallContext" in dotnetcore

Created on 8 Dec 2016  路  9Comments  路  Source: dotnet/runtime

area-System.Runtime

Most helpful comment

what alternatives do we recommend to System.Runtime.Remoting?

@SimpleDays, I assume you're just looking to flow data across asynchronous operations? Assuming yes, you want AsyncLocal<T>: https://msdn.microsoft.com/en-us/library/dn906268(v=vs.110).aspx

All 9 comments

Hi @SimpleDays. Remoting is not currently supported in .NET Core. What is your scenario?

I need to use this class. Is there any other substitute in .Net Core? @danmosemsft

@stephentoub what alternatives do we recommend to System.Runtime.Remoting?

AsyncLocal rather than CallContext?

Example usage differences in AspNetCore's HttpContextAccessor and ifdefs for frameworks (though it should be static, issue https://github.com/aspnet/HttpAbstractions/issues/723)

what alternatives do we recommend to System.Runtime.Remoting?

@SimpleDays, I assume you're just looking to flow data across asynchronous operations? Assuming yes, you want AsyncLocal<T>: https://msdn.microsoft.com/en-us/library/dn906268(v=vs.110).aspx

thx @danmosemsft @benaadams @stephentoub i try to use it. :smile:

@benaadams @stephentoub @danmosemsft
I use AsyncLocal<T> to solve the problem. thx! :smile: :+1:
i close this issue.

Hi, AsyncLocal<T> always copy value to next or child thread, its like CallCotext.LogicGetData. How about CallContext.GetData?
https://stackoverflow.com/questions/53406968/is-there-any-implement-of-callcontext-getdata-setdata-in-net-core

You should use ThreadLocal<T> to mimic the behaviour of CallContext.GetData.

Was this page helpful?
0 / 5 - 0 ratings