Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set `OutputPath` in a Visual Studio 2017 project (new .csproj file format) without the target framework cluttering the resolved path?

Setting OutputPath in the new Visual Studio 2017 project format automatically adds the target framework in the path. For example, if I have these set in the project file:

<TargetFramework>net462</TargetFramework> <OutputPath>/build/debug/<OutputPath> 

The actual output folder will resolve to /build/debug/net462/, not /build/debug/ like in the older versions. How do I solve this without workarounds like moving things around with post build actions?

like image 259
aksu Avatar asked Apr 25 '17 06:04

aksu


People also ask

How do I open a .csproj file in Visual Studio 2017?

Right-click on your project in solution explorer and select Unload Project. Right-click on the project (tagged as unavailable in solution explorer) and click "Edit yourproj. csproj". This will open up your CSPROJ file for editing.

What is Csproj file in Visual Studio?

A CSPROJ file is a C# (C Sharp) programming project file created by Microsoft Visual Studio. It contains XML-formatted text that lists a project's included files and compilation options. Developers compile CSPROJ files using MSBuild (the Microsoft Build Engine).

Where is Csproj file 2017?

What I often in Visual Studio 2017 RC3 to edit the csproj file, is: Right click on the project title in the Solution Explorer window. Select the option "Edit [project name]. csproj" to open the csproj file in the code editor window. Show activity on this post.


1 Answers

The solution is to use AppendTargetFrameworkToOutputPath https://www.tabsoverspaces.com/233608-stopping-msbuild-appending-targetframework-to-outputpath/

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> 
like image 116
aksu Avatar answered Sep 26 '22 04:09

aksu