Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong path when trying to build Windows App project on command line with msbuild

I am trying to use MSBuild to build a Windows 8.1 Phone and a Windows 8.1 Desktop app. The project contains a Shared Folder for common code and a folder each for the Phone and the Desktop App. My Computer is running Windows 10 preview with Visual Studio 2015. When I try to build the app with the commandline via MSBuild:

>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild AppName.sln /p:VisualStudioVersion=14.0

I get errors because Windows is trying to create folders with a wrong path:

Creating directory "bin\Debug\C:\Users\Username\Documents\Visual Studio 2015\Projects\....".

Does anyone know how I can fix this?

like image 492
Display name Avatar asked Jul 20 '15 06:07

Display name


1 Answers

change the <OutputPath></OutputPath>

You can find explanation about the tag in Visual Studio Templates

So, for example, the C# Console Application template is located in

\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\Windows\1033\ConsoleApplication\consoleapplication.csproj

The csproj is an XML file that you can edit at your will. The build output directory is define like this (for each configuration):

...
<OutputPath>bin\Debug\</OutputPath>
...
<OutputPath>bin\Release\</OutputPath>
...

If you change this file, it will change all your future new C# Console Application projects.

like image 189
DeJaVo Avatar answered Oct 12 '22 23:10

DeJaVo