473,480 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Callbacks from .NET 1.1 process to .NET 2.0

Is it possible to call a .NET 2.0 delegate from an event in a .NET 1.1
process? We have a class compiled with Framework 1.1 that has a public
Event called 'Error.' That class is instantiated in a separate
process and made available to our Framework 2.0 process via
Remoting. A class in the 2.0 process hooks up to the 1.1 event.

When Visual Studio steps through the code in the 2.0 process, it
shows Error as always being non-null, and hooked up to the proper
delegate. However, the .NET 1.1 process always claims that the Error
event is null, and thus cannot call it.

I assume that this is a result of the difficulties of calling events
in unknown assemblies (the 2.0 app references the 1.1 assembly, but
not vice versa because 1.1 apps are seemingly unable to reference 2.0
assemblies). During remoting instantiation, the TypeFilter.Full
property is set.

What manner can be used to let 1.1 callbacks receive 2.0 delegates?

Jun 26 '06 #1
7 1443
Hi dbooksta,

Thanks for your post!

Based on my knowledge and testing, in VS.net2003, we can not reference
..Net2.0 assembly. While .Net remoting requires both client and service
reference the assembly containing remoting class. Can you show me some
detail information regarding how do you do remoting between .Net1.1 and
..Net2.0? Do you place the remoting class in a .Net1.1 assembly, so that
both client and server can reference it without any problem?

For efficiency's sake, is it possible for you to provide a sample project
to demonstrate the problem? Then we can troubleshoot it efficiently.

I look forward to your feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 27 '06 #2
I have posted a minimal sample solution demonstrating the problem at
http://204.9.191.76/NailYale/RemoteSample.zip

This is all VS2005; we are using MSBee to force the remote process to run
under .NET 1.1. (See the Readme.txt for info on where to get that plug-in).

Is this sufficient to see and help with this problem?
""Jeffrey Tan[MSFT]"" wrote:
Hi dbooksta,

Thanks for your post!

Based on my knowledge and testing, in VS.net2003, we can not reference
.Net2.0 assembly. While .Net remoting requires both client and service
reference the assembly containing remoting class. Can you show me some
detail information regarding how do you do remoting between .Net1.1 and
.Net2.0? Do you place the remoting class in a .Net1.1 assembly, so that
both client and server can reference it without any problem?

For efficiency's sake, is it possible for you to provide a sample project
to demonstrate the problem? Then we can troubleshoot it efficiently.

I look forward to your feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 27 '06 #3
Hi Dave,

Thanks for your feedback.

I will perform some test and research on your sample project. I will update
you ASAP. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jun 28 '06 #4
Hi Dave,

Yes, I can reproduce out this problem now. I will spend some more time on
analysising it. Thanks for your patient.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 29 '06 #5
Hi Dave,

I am still contacting US support team for coworking on this issue, is it
possible for you to send an email to je***@online.microsoft.com(remove
"online.")? We will work with you more efficiently. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 3 '06 #6
Solution finally found! It turns out I was not doing the Remoting correctly.

First of all, the remoted class has to inherit from MarshalByRefObject.

Second of all, for the callback to be possible the remoting has to be done
across a TcpChannel with both a Client and Server Sink Provider, like the
following:

BinaryServerFormatterSinkProvider serverProv = new
BinaryServerFormatterSinkProvider();
BinaryClientFormatterSinkProvider clientProv = new
BinaryClientFormatterSinkProvider();
serverProv.TypeFilterLevel =
System.Runtime.Serialization.Formatters.TypeFilter Level.Full;
IDictionary props = new Hashtable();
props["port"] = 2555;
TcpChannel channel = new TcpChannel(props, clientProv,
serverProv);
ChannelServices.RegisterChannel(channel);
Jul 10 '06 #7
Hi Dave,

Thanks for your the solution information!

MarshalByRefObject is a basic point, it seems that we both missed it :-(.

Again, thank you sharing the solution with the community!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 11 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2279
by: Melissa Wallis | last post by:
I have a class with 5 callbacks. Two of the callbacks work fine but the others don't. The main difference is that the callbacks that don't work are composed of a sequence of structs. I noticed a...
5
1349
by: Dave Benjamin | last post by:
Is there a straightforward way to create a generator from a function that takes a callback? For instance, I have a function called "process": def process(text, on_token): ... For each token...
0
2696
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
5
3231
by: Christopher Jastram | last post by:
I'm a self-taught programmer, so this might be a pretty dumb question. If it is, please point me in the right direction and I shall apologize profusely. I have a question regarding C++ and...
0
1135
by: anilkoli | last post by:
I want clear cut idea about callbacks and also of delegates I have doughts about callbacks, I feel callbacks are used for 1. recursion 2. dynamically calling a perticular method out of many...
9
3327
by: zholthran | last post by:
Hi folks, after reading several threads on this issue (-> subject) I fear that I got a problem that cannot easily be solved by the offered workarounds in an acceptable way, at least not with my...
1
2189
by: geoffschmidt | last post by:
I'm trying to write an extension in C that delivers callbacks to Python. The C code starts several threads, and I'd like one of the new threads that is started to be able to deliver callbacks to...
15
8365
by: dennis.richardson | last post by:
Greetings all. Here's a problem that's been driving me nuts for the last 48 hours. I'm hoping that someone has come across this before. I have a C# Application that reads a UDP broadcast...
0
2029
by: kronus | last post by:
I need further help in understanding how callbacks work with Alfresco. I am able to connect to alfresco and I’m trying to return a list of users from three groups, but it seems that I don’t quite...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7084
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.