locked
Writing a PeerApplication with v3.5 RRS feed

  • Question

  •  

    Hi Guys,

    Got a quick question - trawlling through the API's did not see it and appreciate any pointers.

    1. If I want to create a new PeerApplication (similar to Windows Meeting Space), how do I go about writing that?
    2. Is it possible in .NET or is it unmanaged code?

    I am using Beta 2 of .NET v3.5 on Vista x32.

     

    Thanks,

    Amit.

    Thursday, October 11, 2007 12:10 AM

Answers

  • All,

    So switching off UAC (I am running on Vista), and changing the scope back to AllUsers worked fine - essentially the UAC is preventing the registration - which is what I would expect it to do.

     

    If switching off the UAC is not an option (or quite painful) a better way to go about this would be to run the process (which is registering the application) with elevated privileges.

     

    There are also a couple of registry entries that can be modified to achieve the same result. I'll muck around those a little more and post back my results.

     

    Amit.
    Friday, October 12, 2007 1:01 AM

All replies

  •  

    Hi Amit,

    You will find lot of good information on P2P in P2P team blog at: http://blogs.msdn.com/p2p/.

    Please let me know if you have any specific question.

    Thanks,

    Pritam

     

     

     

    Thursday, October 11, 2007 1:17 AM
  • Pritam,

    Sorry I probably was not very clear; I am quite comfortable about writing P2P applications and also know of the P2P blog.

     

    The question was if I wanted to write my own application so it can be used for collaboration by PNM (similar to Windows Meeting Space) how do I go about doing this? As you are aware these applications are exposed via the PeerApplication class in the System.Net.PeerToPeer.Collaboration namespace and currently when I get a list of all registered applications (via GetLocalRegisteredApplications) I only see Windows Meeting Space.

     

    So, the question is are these any "special applications" or if they are any p2p app then I can register them. I could not find too many details on how to go about this and wanted some pointers.

     

    I am on Beta 2 of .NET 3.5.

     

    Thanks,

    Amit.

     

    Thursday, October 11, 2007 8:26 AM
  • Pritam,

    After thinking this thru a bit (which I should have done in the first place ) I guess to put it simply the question is how do I registered an application with the peer collaboration infrastructure so someone can invite another peer (either PNM or Contact) to launch that?

     

    Thanks,

    Amit.

    Thursday, October 11, 2007 11:54 AM
  • I created a new PeerApplication object essentially pointing to notepad.exe and when I tried registering it using RegisterApplication I essentially get a Access denied error. So, I am doing something wrong but not sure what it is.

     

    Here is the exception detail (trimmed) and if you look at the InnerException that is an access denied:

     

    Code Block

     

    System.Net.PeerToPeer.PeerToPeerException was unhandled
      Message="Peer collaboration register application failed."
      Source="System.Net"
      StackTrace:
           at System.Net.PeerToPeer.Collaboration.PeerCollaboration.RegisterApplication(PeerApplication application, PeerApplicationRegistrationType type)

    ......
      InnerException: System.ComponentModel.Win32Exception
           Message="Access is denied.\r\n"
           ErrorCode=-2147467259
           NativeErrorCode=-2147024891
           InnerException:

     

     

    Thanks,

    Amit.

    Thursday, October 11, 2007 12:59 PM
  • Hi Amit,

     

    It is very much possible to write a P2P application using purely managed code. Peer Channel is your answer and this solution also comes from teh P2P team. Please take a look at http://blogs.msdn.com/peerchan for more information.

     

    Hope this helps!

    -Shalini.

    Thursday, October 11, 2007 11:25 PM
  • Shalini,

    Thanks for your reply however my question is not if I can write P2P "managed" application. I already have a P2P chat application (using PeerChannel); I want to register this application and have available via PNR and when I try and register I get the Access denied exception as detailed earlier in this thread.

     

    The question is, what am I missing? Why do I get an Access denied ex and how do I go about to working around it.

     

    I have not had a chance to look at the unmanaged API and try that.

     

    Any pointers would be appreciated.

     

    Thanks,

    Amit.

     

    Thursday, October 11, 2007 11:43 PM
  • I see - I am not familiar with this, but I'll try and find out some inforamtion from folks who know more about the .NET classes. In the meanwhile, i wonder if this is something to do with LUA (running elevated) or something ( i would try executing this code in elevated mode)...again, I am just guessing and somebody on our team who knows more should get back to you.

     

    -Shalini.

     

     

     

    Thursday, October 11, 2007 11:55 PM
  • Ok I played around a bit wiht these APIs and i was able to work around the AccessDenied exception by registering only in teh CurrentUser scope. And i verified that the application is registered by enumerating it using GetLocalRegisteredApplications...Can you try this and let me know if it works for you?

     

    -Shalini

    Friday, October 12, 2007 12:20 AM
  • Good point, I did not think of that of looking at the scope. Changing it worked but is interesting - I'll switch off UAC and see if that makes a difference for changing the scope to AllUsers. I'll keep you posted.

     

    Thanks.

    Friday, October 12, 2007 12:26 AM
  • All,

    So switching off UAC (I am running on Vista), and changing the scope back to AllUsers worked fine - essentially the UAC is preventing the registration - which is what I would expect it to do.

     

    If switching off the UAC is not an option (or quite painful) a better way to go about this would be to run the process (which is registering the application) with elevated privileges.

     

    There are also a couple of registry entries that can be modified to achieve the same result. I'll muck around those a little more and post back my results.

     

    Amit.
    Friday, October 12, 2007 1:01 AM
  •  Amit Bahree wrote:

    All,

    So switching off UAC (I am running on Vista), and changing the scope back to AllUsers worked fine - essentially the UAC is preventing the registration - which is what I would expect it to do.

     

    If switching off the UAC is not an option (or quite painful) a better way to go about this would be to run the process (which is registering the application) with elevated privileges.

     

    There are also a couple of registry entries that can be modified to achieve the same result. I'll muck around those a little more and post back my results.

     

    Amit.

     

    hi

      At present i am facing a problem .i am developing peer to peer communication application on .Net 3.5.how i can apporach that .Actually requirement is this there is no server for communication in peer to peer application.please help me .

     

    Thanks in Advance

    Wednesday, December 26, 2007 10:22 AM
  • Hi there Pankaj,

     

    In the future, please try to not post to a closed thread unless the problem is relevant to the discussion in the thread; even then you might not be guaranteed a timely response if it's a real old thread- i just happened to subscribe to comments to this thread hence my response Smile. I would suggest either searching for relevant threads so you dont have to post duplicate questions OR starting a brand new one and we can point you to previous discussions etc..

     

    Anyways, please check our blog, http://blogs.msdn.com/peerchan for information on how to get started, where to get our samples etc..

     

    Hope that helps.

    -Shalini.


    Wednesday, December 26, 2007 7:28 PM
  • hi

      sorry for that.actuaaly now i have devlopede a peer to peer chat application using wcf application in .Net.in this application first we start the server and then clients can communicate on same or different computer.

     Actaully probelm is this if any client send any messsage to anyone then this message goes to all clients which are connecting with server.how i can make this apllication as private chatting .please help me .

     

    Thanks in Advance. 

     

    Thursday, December 27, 2007 5:03 PM
  • hi

    Please send me some answer of this question which i post before this .please help me as soon as possible.

    Thanks in Advance.

     

    Saturday, December 29, 2007 7:27 AM