Skip to content

'Invalid static method invocation syntax' error in Microsoft.Windows.SDK.BuildTools.MSIX.Packaging.targets #6396

@ZarehD

Description

@ZarehD

Describe the bug

Error:

MSB4186: Invalid static method invocation syntax: "[System.String]::Copy(Inter-Italic-VariableFont_opsz,wght.ttf).EndsWith('.deps.json')". Method 'System.String.Copy' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order.

File:

C:\Users\<user>\.nuget\packages\microsoft.windows.sdk.buildtools.msix\1.7.20250829.1\build\Microsoft.Windows.SDK.BuildTools.MSIX.Packaging.targets

Faulting Code:
Line 4336
Mmissing single-quotes around %(FileName)%(Extension) parameter in [System.String]::Copy call.

<_PublishDepsJsonFiles Include="@(_PublishPackagingOutputs)"
  Condition="'@(_PublishPackagingOutputs)' != '' and $([System.String]::Copy(%(FileName)%(Extension)).EndsWith('.deps.json'))" />

Fix:
Add single qutes around the %(FileName)%(Extension) parameter:

... and $([System.String]::Copy('%(FileName)%(Extension)').EndsWith('.deps.json'))

Version Info:
OS: Win11 Pro, 25H2 (OS Build: 26200.8117)
IDE: VS2026 v18.4.3
Project: .NET-10 MAUI Windows app

<PropertyGroup>
  <WindowsPackageType>MSIX</WindowsPackageType>
</PropertyGroup>

Steps to reproduce the bug

  1. Create a default MAUI packaged (MSIX) project from template.
  2. Build the project.

Expected behavior

MAUI project builds successfully without errors.

Screenshots

No response

NuGet package version

1.7.20250829.1 --> installed by VS2026 IDE

Packaging type

Packaged (MSIX)

Windows version

No response

IDE

No response

Additional context

The MSIX Packaging Tools were installed as part of the VS 2026 .NET Desktop Development workload. They were not installed separately as a Nuget package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-MSIXBuildToolsMSIX deployment technology in Microsoft.Windows.SDK.BuildTools.MSIXneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions