none
Issue with Visual Studio debug mode

    Question

  • Hi,

    I am working on a cross platform Xamarin project and having a strange problem with the visual studio 2015 in debug mode for Android. When I try to open a websocket, it breaks with a socket exception as below.

    Exception:
    System.Net.Sockets.SocketException: Access denied

    This works perfectly fine in the release mode and in visual studios installed in other machines. I have reverted back all the environmental settings, all the exception settings and updated the Android SDK, but the exception still persists. Please help with this.

    Thanks,
    sk

    Friday, July 15, 2016 11:45 PM

Answers

  • Hi sk,

    >> After using it, I found the vslogs.zip folder with a log file which was empty

    I think the Temp folder was cleaned. To solve this, you need to repair your Visual Studio. Then collect the logs again.

    By the way, before repairing your Visual Studio. Please use SubInACL tool repair file and registry permissions and check whether it solved your issue.

    http://blogs.msdn.com/b/astebner/archive/2006/09/04/739820.aspx

    Best Regards,

    Lake Xiao

    Tuesday, July 26, 2016 1:51 AM
    Moderator

All replies

  • Hi sk,

    Thanks for your post.

    >>This works perfectly fine in the release mode and in visual studios installed in other machines.

    How about testing it in Debug mode in other machines? Does it still give the same error message?

    >>System.Net.Sockets.SocketException: Access denied

    According to the error message, the problem is more related to the permission for Debug module. As far as I know, in debug mode, it will load the corresponding assemblies. I suppose you have no permission to access these assemblies. Please try to run your Visual Studio as administrator then try it again.

    In addition, since your issue is more related to the Xamarin development. I suggest you'd better post it to the Xamarin forum for better support.

    https://forums.xamarin.com/

    Thanks for your undersatnding.

    Besdt Regards,

    Lake Xiao

    Monday, July 18, 2016 2:55 AM
    Moderator
  • Hi Lake,

    Thank you very much for your reply. 

    It works perfectly fine in other machines in debug mode. It never gives the same error in other machines. As per you suggestion, I ran it in administrator mode and it worked fine. I have also posted this in Xamarin forum and I have not received any answer back. So, do you have any idea what possible permission I have change to make it running again?

    Thanks and Regards,

    sk

    Monday, July 18, 2016 4:02 PM
  • Hi sk,

    >>I ran it in administrator mode and it worked fine.

    If it works fine when run as administrartor. I think you the project file or the location you need the administrator to access. One idea I think is to add your user into the local Administrator gruop. Or you can change the location of the project file, copy it to a folder you can access it. Like D disc.

    Best Regards,

    Lake Xiao

    Tuesday, July 19, 2016 1:16 AM
    Moderator
  • Hi Lake,

    Yesterday after reading your suggestion,I ran my visual studio as an administrator and my project ran fine without any socket exception, but after some time the same socket exception occurred even running in the administrator mode. The problem still persists till now. I don't understand the deal here. 

    I verified that the user I am using is already a local account administrator. I also tried copying my project in some other location, but the issue did not resolve. Hence, if you could guess what permission I messed up in my project, then it would be of great help. 

    Thanks and Regards,

    sk


    Sitakanta Mishra

    Tuesday, July 19, 2016 4:04 PM
  • Hi  sk,

    I am not sure which permission you missed. But if you can run this application on other machine. In order to exclude the cause of the Visual Studio. Please try to repair your Visual Studio at first.

    Then restart you machine, disable anti-virus software and firewall then run your Visual Studio as administrator.

    By the way, please also test with a new created cross platform Xamarin project.

    Best Regards,

    Lake Xiao

    Wednesday, July 20, 2016 2:02 AM
    Moderator
  • Hi Lake,

    Something is really strange happening inside my Visual Studio. Sometimes, it runs fine in debug mode as well and sometimes it does not. Anyways I will try to do the things you have suggested. Thank you very much for your help. I appreciate it. 

    Thanks and Regards,

    sk


    Sitakanta Mishra

    Wednesday, July 20, 2016 6:01 PM
  • Hi sk,

    If it works well sometimes . I think the issue is not related to the permission. Please repair your Visual Studio and run as administrator to check whether it can works well.

    If the issue solved, please mark the reply which is helpful as answer. If the issue still exists. Please feel free to let me know, I will try my best to help you solve it.

    Best Regards,

    Lake Xiao

    Thursday, July 21, 2016 2:14 AM
    Moderator
  • Hi Lake,

    I repaired my visual studio and it took a long time to re-configure. Then I ran my visual studio as an administrator. I did not get the socket exception in the debug mode for sometime, but then it again started to come. It did not help. 

    Thanks and Regards,

    sk


    Sitakanta Mishra

    Thursday, July 21, 2016 6:28 PM
  • Hi sk,

    I need your help to the VS installation log. Please use http://aka.ms/vscollect to gather the installation logs. After using it, you will find vslogs.zip under %temp% folder. Please upload the file to https://onedrive.live.com/ and share the link here.

    Then I will help to check whether there exists some errors in your VS installation.

    Best Regards,

    Lake Xiao

    Friday, July 22, 2016 1:23 AM
    Moderator
  • Hi Lake,

    I just want to cross-verify here. So, to collect these logs, do I have to repair/re-install my VS again or these logs should be somewhere and I just need to get it? I am asking this because the repairing takes a long time and re-installation of VS is gonna trouble my project work. Please let me know.

    Thanks and Regards,

    sk 


    Sitakanta Mishra

    Friday, July 22, 2016 3:54 PM
  • Hi sk,

    >>do I have to repair/re-install my VS again or these logs should be somewhere and I just need to get it?

    You'd better repair the VS at first. Then open your Visual Studio and reproduce your issue. Then use  http://aka.ms/vscollect to gather the installation logs. After using it, you will find vslogs.zip under %temp% folder. Please upload the file to https://onedrive.live.com/ and share the link here.

    Best Regards,

    Lake Xiao


    Monday, July 25, 2016 1:10 AM
    Moderator
  • Hi Lake,

    I repaired my visual studio two days ago. So, now I just tried to reproduce my issue and run the vscollect tool. After using it, I found the vslogs.zip folder with a log file which was empty. I don't understand what am I doing wrong here. Do I need to repair my VS again before reproducing my issue?

    Thanks and Regards,

    sk


    Sitakanta Mishra


    • Edited by skm05 Monday, July 25, 2016 5:49 PM
    Monday, July 25, 2016 5:49 PM
  • Hi sk,

    >> After using it, I found the vslogs.zip folder with a log file which was empty

    I think the Temp folder was cleaned. To solve this, you need to repair your Visual Studio. Then collect the logs again.

    By the way, before repairing your Visual Studio. Please use SubInACL tool repair file and registry permissions and check whether it solved your issue.

    http://blogs.msdn.com/b/astebner/archive/2006/09/04/739820.aspx

    Best Regards,

    Lake Xiao

    Tuesday, July 26, 2016 1:51 AM
    Moderator