none
Incorrect function when trying to run/debug in VS2017

    Question

  • I found a similar post here (https://social.msdn.microsoft.com/Forums/en-US/cef5a34f-e066-4eba-8f59-4eda5112cc6e/visual-studio-2017-incorrect-function-when-trying-to-run?forum=visualstudiogeneral) where the OP is using VS2017 and has offline file and folder redirection setup for the Documents folder.

    As VS by default wants to store the Projects directory in the users Documents folder, I have left this default setting in place so I don't have to separately manage the backup of any projects.

    The full error is:

    Error while trying to run project: Unable to start program '\\SERVER\Home\JBloggs\Visual Studio 2017\Projects\Test\bin\Debug\Test.exe'.

    Incorrect function.

    The workaround is to move the Projects folder to the root of the C drive but should VS work with offline files/folder redirection?

    I've tried running VS as Administrator and it makes no difference.

    Edit: this only seems to be a problem when the computer is offline and has no access to the redirected folder.  When it is online with access to the redirected folder, VS works as expected.
    • Edited by Tippers Wednesday, April 26, 2017 7:36 AM Update
    Tuesday, April 25, 2017 8:50 PM

All replies

  • Hi Tippers,

    >>Edit: this only seems to be a problem when the computer is offline and has no access to the redirected folder.  When it is online with access to the redirected folder, VS works as expected.

    Glad to know that this issue has been resolved, I just help you post the solution as the answer.

    Of course, if possible, you could mark the solution as the answer,  so it could help other community members who meet the same issue as yours, and I could close this case for you.

    Thank you for your support and co-operation:)

    Sincerely,

    Jack


    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.

    Thursday, April 27, 2017 8:29 AM
    Moderator
  • Hi Jack,

    The edit of my original post wasn't intended to be an answer as I'd like to know if it is supported/intended to work when the computer is offline as it's not always possible to be connected to the server.

    Can you clarify this please?

    Chris

    Thursday, April 27, 2017 9:22 AM
  • Hi Chris,

    >>Error while trying to run project: Unable to start program '\\SERVER\Home\JBloggs\Visual Studio 2017\Projects\Test\bin\Debug\Test.exe'.

    Do you save your project in your local machine or the network drive?

    Generally it doesn't require the network if you run your app locally, but it seems that the project was saved to the network drive(not local).

    If the project was local, could you open test.exe directly in your project folder?

    Best Regards,

    Jack


    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.

    Thursday, April 27, 2017 10:23 AM
    Moderator
  • Hi Jack,

    So I have two features of Windows enabled on my laptop.  Firstly offline files enabled me to replicate selected network folders when connected to the network so when I am disconnected I can still access those files and directories.

    Secondly, I have folder redirection so my My Documents/Documents folder is not stored with the local profile but instead redirected to my Home directory, which is a network folder, which has been enabled for offline files.

    This means that the default location (My Documents/Documents) for the Visual Studio 2017 folder (containing Projects etc) works fine when connected to the server but when it can't see the server and is in an offline state, I assume VS2017 doesn't like how the offline files feature stores the files and produces the above error.

    Regards

    Chris

    Thursday, April 27, 2017 4:18 PM
  • Hi Chris

    Based on the result, I also agree with you, the error means that the Visual Studio couldn't find or load the process with the network.

    Actually I didn't repro this issue in my side, do you use the Redirecting Folders feature like this document? 

    https://technet.microsoft.com/en-us/library/cc977970.aspx

    (1)If you run your VS as the admin, how about the result?

    (2)Do you test it using other VS version like the VS2013/VS2015? At least, we could know that whether just the VS 2017 has this issue.

    Best Regards,

    Jack


    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.

    Friday, April 28, 2017 10:16 AM
    Moderator
  • Hi Jack,

    Yes that article describes how I have setup folder redirection.

    I have run VS as admin but I get the same result.

    I haven't tried VS2013/2015.  I currently use 2010 but I have configured the Projects folder on a custom folder on the root of the C drive.  I'd prefer to have the project data saved in my Documents folder.

    Regards

    Chris

    Friday, April 28, 2017 10:39 AM
  • Hi Chris,

    Thanks for your friendly response.

    If so, my understanding is that it would require the network connections. We often saved the project to our local machine, and the network share or use the redirect folder may impact the performance more or less.

    Of course, if you have good suggestions, you could submit a feature request to the product team here:

    http://visualstudio.uservoice.com/forums/121579-visual-studio.

    Sincerely,

    Jack


    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.

    Sunday, April 30, 2017 4:20 AM
    Moderator