TcpChannel Class Example Has Errors
Type of issue
Code doesn't work
Description
[Enter feedback here] When I copy and paste the code example of a server(https://learn.microsoft.com/en-us/dotnet/api/system.runtime.remoting.channels.tcp.tcpchannel?view=netframework-4.8.1) into a console app in VS2022, it has a lot of errors. Even the "using System.Runtime.Remoting.Channels;" is an error. code example shows a server.zip Where do i find a working example or how to fix this one. Need to add what IDE that the examples worked on to reduce problems
Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.remoting.channels.tcp.tcpchannel?view=netframework-4.8.1
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Runtime.Remoting.Channels.Tcp/TcpChannel.xml
Document Version Independent Id
be2b05de-e3ef-5732-416d-624b057189f9
Article author
@dotnet-bot
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
How do I fix this problem
After reading the four emails responses I received, is my question on "TcpChannel Class Example Has Errors" still open for someone to answer or is it closed?
This issue is still open and we will look into it, I closed the other issue you opened because it is a duplicate of this one.
Thanks for responding
From: Radek Zikmund @.> Sent: Monday, August 26, 2024 3:48 AM To: dotnet/dotnet-api-docs @.> Cc: MaxFun @.>; Author @.> Subject: Re: [dotnet/dotnet-api-docs] TcpChannel Class Example Has Errors (Issue #10314)
This issue is still open and we will look into it, I closed the other issue you opened because it is a duplicate of this one.
— Reply to this email directly, view it on GitHub https://github.com/dotnet/dotnet-api-docs/issues/10314#issuecomment-2309912442 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6AGGH4NX5XBZVDAYCVDW3ZTMBV5AVCNFSM6AAAAABNCRCOL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBZHEYTENBUGI . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AA6AGGGKVKAIGJA5BGDUBF3ZTMBV5A5CNFSM6AAAAABNCRCOL6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUJVZ3XU.gif Message ID: @.*** @.***> >
Which .NET are you targetting? That definitely works with .NET 4.8 - you need to create 3 .NET 4.8 projects: server, client and shared library and add reference to System.Runtime.Remoting in the server and client; both server and client should also reference shared project - note that it's not recommended to use this feature and you're probably better using System.Text.JSON Serialize/Deserialize
I am targeting .NET 4.8.1 and using System.Runtime.Remoting . In the line of code of the server, "using System.Runtime.Remoting.Channels.Tcp;" has an error for the ".Tcp and other line also have errors Started a new console app server using .NET 4.8 and get the same errors as before. I am using Microsoft Visual Studio Community 2022 (64-bit), Version 17.9.3. What version of Visual Studio did it work on?
When you open .csproj whichever you see the error in with the text editor can you see something similar to:
<Reference Include="System.Runtime.Remoting" />
This shouldn't matter what version of VS you're using - just .NET version
Not sure what you mean by " open .csproj whichever you see the error in with the text editor"
If I open TestServer.csproj with VS Code, I do not see anything similar to "<Reference Include="System.Runtime.Remoting" />"
Attached is the build error list.