visual-studioazure-devops

Error MSB4236 only on one project on the Azure build system


I just ran in a strange problem when moving to the SDK format for the csproj The build system throw for exactly one project a MSB4236: The SDK "Microsoft.NET.Sdk" specified could not be found.

Building Local works and other projects with similar SDK style .csproj work on the build system.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
    <PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\an\other.csproj" />
  </ItemGroup>

</Project>

Solution

  • I think the problem where that the <ProjectReference Include="..\..\an\other.csproj" /> where a x86 old format .csproj project and in the failing project <PlatformTarget>x86</PlatformTarget> inside the <PropertyGroup> where missing.

    I assume that the reason that I only goth a MSB4236: The SDK "Microsoft.NET.Sdk" specified could not be found. is that the other project where still in the old format.

    So basically I writhe this post just in case some on else (or I) get the same problem.