dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

TcpChannel Class Example Has Errors

Open MaxFun opened this issue 1 year ago • 10 comments

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

MaxFun avatar Aug 25 '24 13:08 MaxFun

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.

ghost avatar Aug 25 '24 13:08 ghost

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.

ghost avatar Aug 25 '24 13:08 ghost

How do I fix this problem

MaxFun avatar Aug 25 '24 13:08 MaxFun

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?

MaxFun avatar Aug 26 '24 10:08 MaxFun

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.

rzikm avatar Aug 26 '24 10:08 rzikm

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: @.*** @.***> >

MaxFun avatar Aug 26 '24 10:08 MaxFun

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

krwq avatar Aug 28 '24 09:08 krwq

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?

MaxFun avatar Aug 28 '24 10:08 MaxFun

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

krwq avatar Sep 03 '24 13:09 krwq

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. BuildErrorList

MaxFun avatar Sep 03 '24 16:09 MaxFun