Use relative paths for working directory & start in C# project
Edit directly in the .csproj file without escaping the characters, like this:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartWorkingDirectory>$(SolutionDir)..\..\..\..\mydir</StartWorkingDirectory>
<StartProgram>$(SolutionDir)..\..\dir\myapplication.exe</StartProgram>
</PropertyGroup>
</Project>
Also there is no need for the slash after $(SolutionDir)
I know this might sound the same as others, I just want to be clear you did exactly this.
You should
- close visual studio - it's important as it might override your file if you keep it open
- open myproject.csproj.user using notepad.
enter this
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ProjectView>ProjectFiles</ProjectView> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <StartAction>Program</StartAction> <StartWorkingDirectory>$(SolutionDir)..\..\..\..\mydir</StartWorkingDirectory> <StartProgram>$(SolutionDir)..\..\dir\myapplication.exe</StartProgram> </PropertyGroup> </Project>
Close notepad
- Open Visual Studio
- Go to project properties and confim you see this