Problem with build target and relative path in project with no (not in this one) mgcb

Hi !
I have a problem building (with Visual2017) my game since MG dev 3.7.744 / 753. It works with the 737.
The problem is: I have somewhere a relative path …/…/xyz in my folder “launcher” pointing to one of the subfolders of folderofsolution:
Drive i:
-FolderOfDevelopment
-|-FolderOfSolution
—|
—|-game
—|-launcher
—|-… etc

But with these 2 builds the launcher’s path points to 2 parents from folderofsolution, and MSBuilds fails to build:


Where Data/DressageChiot is at the root of i:

Does anyone have an idea if it comes from a problem in my projects or MG ?

If I open the project on another computer it points to another folder. So it is not the project that points to a specific folder.
And no reference to any …/…/…/ (3 folders up) anywhere in ANY of my files
Above 737 it cannot build as well on this machine.

From TeamCity,

I’ve narrowed the problem to the build 745. Up to the 742(including this one) my app builds.

Can you give some more information? Is the relative path in the mgcb or the csproj? Where is it relative from? “somewhere in folder ‘launcher’” is not helpful for us to track this down. What is it supposed to point to?

It is not in the mgcb as I don’t build content along with the app it takes too much time.
I think it must be in the csproj, but the launcher is only an exe in the folder “launcher” with a reference to the engine’s dll in the “game” folder.
Maybe the order of some xml tags is wrong in the csproj ?
One thing i noticed is i’m using 3.7.0.742, but in the csproj it says 3.6.0.57 which is not installed…
Maybe the ?

Moreover, i reference projects, not dll directly.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{0A3072B2-CFD8-41DB-B5B7-6CE80997C627}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Swift.Launcher</RootNamespace>
    <AssemblyName>__SwiftLauncher</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MonoGamePlatform>Windows</MonoGamePlatform>
    <MonoGameContentBuilderExe>
    </MonoGameContentBuilderExe>
    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
    <TargetFrameworkProfile />
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Windows\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Windows\Release\</OutputPath>
    <DefineConstants>TRACE;WINDOWS</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup>
    <ApplicationIcon>Icon.ico</ApplicationIcon>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x64\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    <OutputPath>bin\x64\Release\</OutputPath>
    <DefineConstants>TRACE;WINDOWS</DefineConstants>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\Windows\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
    <DebugType>full</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <DocumentationFile>bin\Windows\Debug\__SwiftLauncher.XML</DocumentationFile>
    <Prefer32Bit>false</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE;WINDOWS</DefineConstants>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
  </PropertyGroup>
  <PropertyGroup>
    <StartupObject>Swift.Launcher.Program</StartupObject>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="MonoGame.Framework, Version=3.6.0.57, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\Program Files (x86)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Debug\Dummy.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="Icon.ico" />
    <Content Include="Screenshots\dummy.txt">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <None Include="app.config" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Engine\Swift.Engine.csproj">
      <Project>{8a09c2dc-e7ec-488d-b1d4-73cb48b5a846}</Project>
      <Name>Swift.Engine</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

In the screenshot above with the blurred file path, what type of file is it trying to read? Is it one of the files in the csproj? Another file?

Not at all a project file, it takes a random file in a folder at the root of i: in my ex:
Drive i:
-FolderOfDevelopment
-|-FolderOfSolution
—|
—|-game
—|-launcher
—|-… etc
-|-Data(another folder on i:, not a part at all of the project)
—|-DressageChiot (How to train my dog)
—|-folderB
—|-…etc
It takes “Data\Dressagechiot” as the folder to build what i don’t know as everything is in FolderOfSolution, but itseems to take FolderOfSolution as the starting point when going up with …/…/ when it should start from my launcher.csproj in “launcher”

If I put FolderOfDevelopment in another folder, it chooses another folder than “Data\Dressagechiot”, but always 2 parents up, so it becomes Data, and a file in it (always the same, i don’t know it chooses it, it seems to always be the 7th if there are enough files, i don’t know what happens if there is nothing else)

Could it be related to the only significative change I’ve found concerning paths/builds since build 742 in
https://github.com/MonoGame/MonoGame/blame/develop/MonoGame.Framework.Content.Pipeline/MonoGame.Content.Builder.targets

I know my project does not build content, but I could have made something wrong and it does not build content, but still try to build something
How to make a project not build the content of the mgcb ?

Here is the solution’s view:

No mgcb in this project, all content is linked in the swift.engine’s project, which builds without any problem.
With 753, many

4>C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.Content.Builder.targets(94,5): warning MSB4220: Waiting for the currently executing task “CreateItem” to cancel.

when i tried to stop the build as it takes more than 5mins… (743, 15s only, due to the fact it must have been trying to build a large file with this folders path problem)

My output dir in the mgcb file is
/outputDir:…..\Launcher\bin\x64\Debug\Content

Which as the csproj, goes up 2 folders

Even if I remove the reference to swift.engine.dll, it fails with the same problem, whereas there is no mgcb in a sub dll to build

I had suspected that change. I’m looking at it now.

I submitted a potential fix for this (#5886). Try that branch or try the installer generated from it. Let me know if it fixes the issue.

Many thanks :slight_smile:
I’ve just tried it, and it builds normally.
I shall participate to Monogame’s development to fix problems I encounter like this when I manage to free some spare time.