yosi madsu
yosi madsu

Reputation: 314

How to change TargetDir in Visual Studio 2017 netcoreapp2.0?

When I build the netcore 2.0 project, VS2017 generated files in \bin\DEBUG\netcoreapp2.0\* rather than in \bin\DEBUG\*.

It gives a mirage effect while debugging, since the generated app run as in \bin\DEBUG\ folder.

So, my config.json file to load should be in \bin\DEBUG\ folder and so my module folders.

Worse, my modules are netcore project too, and their output folder are in *\netcoreapp2.0 too.

I find it difficult to copy them manually every time I build the projects.

Is there any way to change TargetDir on netcoreapp2.0? (Without post-build commands)

Upvotes: 3

Views: 2360

Answers (1)

yosi madsu
yosi madsu

Reputation: 314

I managed the issue with adding <AppendTargetFrameworkToOutputPath> inside <PropertyGroup> tag. It's an old issue due to the lack of interactive window to set .csproj files, so the file should be edited manually.

The first 5 lines of a .csproj file should look like this,

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>     
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

Upvotes: 7

Related Questions