0

Depending on this SO Question I have modified a csproj.user file to change Visual Studio's build location. At this moment .csproj.user file is:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <OutputPath>R:\VisualStudioBuilds\$(AssemblyName)\bin\$(Configuration)\</OutputPath>
  </PropertyGroup>
</Project>

With that configuration files from build (from Visual Studio) are in R:\VisualStudioBuilds\{ProjectName\bin\{Configuration} - so it's a right path. But Visual Studio has its own path in project properties page: R:\VisualStudioBuilds\bin\{Configuration}\ (ignored assembly's name). This makes run app impossible.

To sum it: When I press "Start (F5)" button in VS output files are under the correct path, but VS cannot start them with error: "The working directory does not exist "R:\VisualStudioBuilds\bin\Debug"".

Is it possible to make Visual Studio respect the $(AssemblyName) variable.

Mikołaj
  • 89
  • 10
  • I got different result, I got the parser error on the web page "An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'WebApplication3.WebApiApplication'.". Are you sure you have set all output path to `R:\VisualStudioBuilds\$(AssemblyName)\bin\$(Configuration)\`, have you try this way on the new blank app? – Leo Liu Oct 10 '18 at 02:34
  • I have done that steps: • create new WPF project (.NET Framework 4.7.1), • ensure build and run (by 'Start' button in VS) are working, • open app folder and duplicate the WpfApp1.csproj file, • change the new file name to WpfApp1.csproj.user, • edit with VS Code: replace the content with the above code without modifications, • save the file and reopen solution in VS. – Mikołaj Oct 23 '18 at 06:00
  • Before restart, on the project property page the output path is `bin\Debug\` after reopenning project the build path in the project property page is `R:\VisualStudioBuilds\bin\Debug\`. Build has done on the `R:\VisualStudioBuilds\WpfApp1\bin\Debug` path, and the app works from this directory (double click in Explorer) but 'Start' button in VS gives me an error 'The working directory does not exist: R:\VisualStudioBuilds\bin\Debug\'. – Mikołaj Oct 23 '18 at 06:00

0 Answers0