Share via

Debug Asp net console a[pp on VS using WSL2?

NALB 71 Reputation points
2023-02-27T09:45:29.8633333+00:00

Hello ,

I have Asp net Console app which runs on windows , I have some tools the runs on WSL2 Linux subsystem from my code I have commands line that I am trying to execute using start process , the tools that I am trying to execute using the commands lines are on Linux my problem now that vs throw error that he cannot find the specified file after opening CMD in Linux i found the below

My question what should I do in order to debug my asp net app which is on windows that runs python tools commands that are on Linux WSL2?

Also is choosing to debug using WSL is same as WSL2?

'\\wsl.localhost\Ubuntu\home\'                                                                                      CMD.EXE was started with the above path as the current directory.                                                       UNC paths are not supported.  Defaulting to Windows directory.                                                          Microsoft Windows [Version 10.0.19045.2604]     


Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

Developer technologies | ASP.NET Core | Other

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,081 Reputation points
    2023-02-28T05:25:42.8266667+00:00

    Process.start can not directly run a Linux application. It can run wsl and pass the Linux command for wsl to execute.

    You could also use a remote shell api like OpenSSL.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.