Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS error when debugging

I'm writing a C# winform application. All went well but suddenly debug won't work. I get this error message:

Error while trying to to run project: Unable to start program [here follows the path of the executable] Input or output cannot be redirected because the specified file is invalid.

Here's the .sln file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stub", "Stub\Stub.csproj", "{C6376D67-EEEC-4AEE-B779-D743D0181636}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {C6376D67-EEEC-4AEE-B779-D743D0181636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {C6376D67-EEEC-4AEE-B779-D743D0181636}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {C6376D67-EEEC-4AEE-B779-D743D0181636}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {C6376D67-EEEC-4AEE-B779-D743D0181636}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

I compared the project's properties with the project's properties of a dummy project and found that in my project under the debug tab in field Command line options this value:

No Command-line

No idea where this came from, but after removing it, debugging works again.

like image 670
Yoav Avatar asked Sep 16 '17 23:09

Yoav


1 Answers

Check your project's properties to contain a field Command line options. If it contains No Command-line then remove it.

like image 111
yacc Avatar answered Sep 29 '22 19:09

yacc