Skip to content

Dotnet build fails on Plugins following install of Visual Studio 2026 November 2026 FU (18.12.0) #1519

Open

Description

@SiPurdy

Describe the bug
Following installation of Visual Studio 2026 November 2026 Feature Update, build fails on plugin projects creating the nupkg.

C:\Temp\newplugin>dotnet build
  C:\Temp\newplugin\newplugin.csproj net48                                                               Restore
Restore complete (2.7s)
  newplugin net48 failed with 1 error(s) (2.9s) → bin\Debug\net48\publish\
    C:\Program Files\dotnet\sdk\11.0.100\NuGet.Build.Tasks.Pack.targets(232,5): error NU5017: Cannot create a package that has no dependencies nor content.

Build failed with 1 error(s) in 7.5s

To Reproduce

  1. Was running Visual Studio 2026 18.11.3

  2. Created new plugin using pac plugin init, followed by a dotnet build, build completes fine.

  3. Update Visual Studio 18.12.0, dotnet build results in the above error.
    Inspecting the created nupkg file, it's created without the lib folder containing the plugin assembly.

  4. Rollback Visual Studio, dotnet build succeeds.
    Proves the issue was caused by changes in the latest Visual Studio update?

Expected behavior
The nupkg file should be created correctly following the update.

Activity

  1. added
    bug
    on Nov 12, 2026
  2. changed the title [-]Dotnet build fails on Plugins following install of Visual Studio 2026 November 2026 FU (12.12.0)[/-] [+]Dotnet build fails on Plugins following install of Visual Studio 2026 November 2026 FU (18.12.0)[/+] on Nov 12, 2026
  3. SiPurdy commented on Nov 16, 2026

    @SiPurdy
    Author

    Bit of an update. The build fails when version 11.0 of the SDK is being used, If you use a global.json file to lock the build to version 10.0, builds work.
    The Microsoft.PowerApps.MSBuild.Plugin package needs updating to support the new SDK version.

  4. mathis-m commented on Nov 16, 2026

    @mathis-m

    We hit the same issue in our CI pipeline after the hosted windows-2025 image 20261111.331 added .NET SDK 11.0.100. The plugin package was built without lib/net462, the build stayed green (only warning NU5128, because our package has dependencies), and the solution import then failed with:

    Import failed: No supported target framework folder found in package. Supported dotnet frameworks are 'net48', 'net471' and 'net462'.

    Root cause

    It's an interaction between Microsoft.PowerApps.MSBuild.Plugin and a NuGet pack change that shipped in SDK 11.0.100:

    1. Microsoft.PowerApps.MSBuild.Plugin.targets registers GetTfmPublishedFiles in TargetsForTfmSpecificBuildOutput. The target adds $(PublishDir)\*.* to BuildOutputInPackage and then sets IncludeBuildOutput=false inside the target. Its comment says this must happen at that time, in the inner build. This is still the case in the latest version, 2.15.1.
    2. Up to SDK 10, NuGet's _WalkEachTargetPerFramework always called the per-TFM targets with an extra TargetFramework=… global property. For single-TFM projects that created a separate project instance, so IncludeBuildOutput=false stayed in that instance and the outer PackTask still saw true.
    3. NuGet.Client#7603 (re-land of #7541, for NuGet/Home#11530) removed that global property for single-TFM projects to avoid redundant evaluations: "Single-targeting: reuse the current (already-built) instance."
    4. With SDK 11 the property therefore leaks into the instance that runs Pack. PackTask receives IncludeBuildOutput=False, and MSBuildProjectFactory.AddOutputFiles() skips all lib/ files, including the published files that GetTfmPublishedFiles added.

    A diagnostic log of our plugin project shows the chain:

    • Set Property: IncludeBuildOutput=false in GetTfmPublishedFiles
    • _BuildOutputInPackage populated with all published DLLs
    • Task Parameter:IncludeBuildOutput=False on PackTask

    Minimal repro (no Power Apps package needed)

    Repro.csproj mirrors the GetTfmPublishedFiles pattern:

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework Condition="'$(Multi)' != 'true'">netstandard2.0</TargetFramework>
        <TargetFrameworks Condition="'$(Multi)' == 'true'">netstandard2.0</TargetFrameworks>
        <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);GetTfmPublishedFiles</TargetsForTfmSpecificBuildOutput>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
      </ItemGroup>
    
      <!-- Same pattern as Microsoft.PowerApps.MSBuild.Plugin.targets (GetTfmPublishedFiles) -->
      <Target Name="GetTfmPublishedFiles">
        <ItemGroup>
          <BuildOutputInPackage Include="$(TargetPath)" />
        </ItemGroup>
        <PropertyGroup>
          <IncludeBuildOutput>false</IncludeBuildOutput>
        </PropertyGroup>
      </Target>
    
      <Target Name="ShowIncludeBuildOutputAtPack" BeforeTargets="GenerateNuspec">
        <Message Importance="high" Text="REPRO: IncludeBuildOutput seen by PackTask = $(IncludeBuildOutput)" />
      </Target>
    </Project>

    Run dotnet pack -c Release, and add -p:Multi=true for the last row:

    SDK Project IncludeBuildOutput seen by PackTask lib/ in nupkg
    10.0.303 TargetFramework true lib/netstandard2.0/Repro.dll
    11.0.100 TargetFramework false (+ NU5128) empty
    11.0.100 TargetFrameworks (plural) true lib/netstandard2.0/Repro.dll

    Without the PackageReference you get NU5017 instead, exactly as in the original report.

    Workaround

    Instead of pinning SDK 10 via global.json, switch the plugin project to the plural TargetFrameworks property, still with a single framework:

    <!-- Plural on purpose: forces a separate per-TFM project instance during pack, see the SDK 11 / NuGet.Client#7603 note above -->
    <TargetFrameworks>net462</TargetFrameworks>

    A multi-targeting project always runs its per-framework steps in a separate project instance, so IncludeBuildOutput=false stays there, as before SDK 11. This relies only on public MSBuild behavior.

    On our real plugin project (net462, Microsoft.PowerApps.MSBuild.Plugin 1.52.1), SDK 10.0.303 and SDK 11.0.100 both produce the same 43 lib/net462 files with this change. The DLL and publish output paths stay unchanged because we set AppendTargetFrameworkToOutputPath=false. If you generate plugin projects with pac plugin init, apply the same change to newly generated projects.

    Things that do not help: forcing IncludeBuildOutput=true, either via -p: or in the project file. SDK 11 still produced an empty lib/ folder in both cases.

    Also consider adding <WarningsAsErrors>NU5128</WarningsAsErrors> to plugin projects, so an empty package fails the build instead of the solution import.

    Ask

    Please update Microsoft.PowerApps.MSBuild.Plugin so that GetTfmPublishedFiles no longer relies on IncludeBuildOutput=false staying in a separate project instance, since SDK 11 reuses the instance for single-TFM projects.

  5. SiPurdy commented on Nov 16, 2026

    @SiPurdy
    Author

    Thanks Mathis Michel (@mathis-m) for the decent write up.
    Si

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions