none
Sockets.cs not found

    Question

  • Hello everyone,

    I am trying to work on a project from my home and office computer. I am using Visual Studio TFS to achieve that. Everything runs fine on my home computer. Now the problem occurs, when I am trying to to debug the Application on my office computer. It throws an error and asks me to find "Sockets.cs", which I cannot find anywhere. Does anyone have an idea how to fix that?

    Thanks in advance!
    Tuesday, November 01, 2016 8:46 AM

Answers

  • Hi Thomas_Fr,

    Please do some settings in your VS.

    Click Tools -> Options -> Debugging -> Uncheck "Enable Just My Code", please refer to the following screenshot:

    Check "Thrown" for System.Net.Sockets.SocketException with the following steps:

    Click Debug menu -> Exceptions -> Expand "Common Language Runtime Exceptions" until you reach "System.Net.Sockets.SocketException" -> Check this exception, please refer to the following screenshot:

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by qing__Moderator Monday, November 07, 2016 7:45 AM
    • Marked as answer by Thomas_Fr Saturday, December 24, 2016 12:13 AM
    Wednesday, November 02, 2016 5:58 AM
    Moderator

All replies

  • Hi,

    did you check that you added the sockets.cs file to source control? Did you check in the changes on the home computer?

    On the office system: Did you get the latest version?

    With kind regards,

    Konrad

    Tuesday, November 01, 2016 8:58 AM
    Moderator
  • Hi Konrad,

    yes, I am sure I Checked in and downloaded everything correctly. How can I add the sockets.cs to the source control? Is it in the original Project folder?

    Kind regards
    Thomas
    Tuesday, November 01, 2016 9:02 AM
  • Hi,

    when you right click the file, then you should have a Add to Source Control. This menu item could also be under the Source Control submenu.

    But if the project is under source control, then new files will be added to source control automatically. Now that I am thinking about it, I see other things that you should check, too:

    a) The file is inside the solution folder on the disk?

    b) The file was added to the project, not "add as link" which is also possible.

    Could you provide a screen shot of the solution explorer window?

    Maybe the Source Control Explorer can also be useful. It shows you, what is on the TFS. So you can go to the directory where the file should be and add the file to source control there. (Rightclick on the folder area and choose "Add Items to Folder".)

    With kind regards,

    Konrad

    Tuesday, November 01, 2016 9:30 AM
    Moderator
  • Hi,

    well... I checked again on both computers. This file doesn't exist anywhere. There never was a file with this name in my project. It is not even on my harddrive. So I doubt, that it's actually got anything to do with the contents of my source control.  The original path and drive also don't exist on neither of the computers. Here the error I am getting: (Sorry, it's in german, but your name suggests, you might be able to read it anyway. ;) )

    Ein Ausnahmefehler des Typs "System.Net.Sockets.SocketException" ist in System.dll aufgetreten.
    Zusätzliche Informationen: Ein ungültiges Argument wurde angegeben

    Is it posible, that network restrictions in my company may cause such problems? Or .NET-issues?

    Thanks for your help Konrad!
    Tuesday, November 01, 2016 10:04 AM
  • Hi Thomas,

    Oh, sorry. I thought that it would have been one of your files where you had some kind of socket wrapper or so in it. You are correct: All my replies are misleading and the problem must be somewhere else.

    So I see 2 topics:

    a) Starting the application on the office system causes an exception. We could go and check the reason for the exception and solve the core issue. Could you provide the code where the exception occurs? (So you might need to check the stack trace to find your code. Maybe you can see some more details inside the debugger e.g. what call did you do and what was the arguments? You could be able to use the stack trace to go up to your code.

    The SocketException can be caused by either the Socket or the Dns class and is a sign of some network problems. So there might be some network issues with your office system. The Exception also has an ErrorCode which might be useful to find the exact error. MAybe you even find a HelpLink inside that exception that gives more information (But to be honest: I doubt that. So far I never saw any useful link in an error message. So do not be surprised if you end at a generic Windows Help page or so :) )

    b) the second, minor issue, could be to get you debug support for .Net. There are multiple options for this e.g. getting pdbs and stuff like that. But unfortunately I cannot really help you with this because I am using an addon (ReSharper) which is doing a lot in this area, too. So I simply do not have any experience with this. (But someone else might help you in this area.)

    With kind regards,

    Konrad

    Edit: Regarding topic 2: The following link might be useful - the thread covers stepping through the .Net Framework source: https://social.msdn.microsoft.com/Forums/vstudio/en-US/7bc17ae3-6480-439c-bec4-66be22dcfe02/obtaining-debug-symbol-pdb-files-for-net-framework-452?forum=clr
    Tuesday, November 01, 2016 10:19 AM
    Moderator
  • Hi Thomas_Fr,

    Please do some settings in your VS.

    Click Tools -> Options -> Debugging -> Uncheck "Enable Just My Code", please refer to the following screenshot:

    Check "Thrown" for System.Net.Sockets.SocketException with the following steps:

    Click Debug menu -> Exceptions -> Expand "Common Language Runtime Exceptions" until you reach "System.Net.Sockets.SocketException" -> Check this exception, please refer to the following screenshot:

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by qing__Moderator Monday, November 07, 2016 7:45 AM
    • Marked as answer by Thomas_Fr Saturday, December 24, 2016 12:13 AM
    Wednesday, November 02, 2016 5:58 AM
    Moderator