Windows icon indicating copy to clipboard operation
Windows copied to clipboard

CommunityToolkit.WinUI.Converters 8.1.240821 -nuget does not install its namespace correctly in WinUI3 for windows x64

Open RossCoeH opened this issue 5 months ago • 1 comments

Describe the bug

Despite having correct nuget dependencies, the CommunityToolkit.WinUI.Converters namespace is not accessible after build giving this error:

Undefined namespace. The 'using' URI refers to a namespace 'CommunityToolkit.WinUI.Converters' that could not be found.

first error line is created at xmlns:converters="using:CommunityToolkit.WinUI.Converters"

Build is correct, package dependencies in solution explorer do not show errors. The .csprog file contains

  <ItemGroup>
    <PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.1.240821" />
    <PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.1.240821" />
    <PackageReference Include="CommunityToolkit.WinUI.Triggers" Version="8.1.240821" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" /> />
    <Manifest Include="$(ApplicationManifest)" />
  </ItemGroup>
	<!--
    Add fix for sdk package version as the default new project is built with 10.0.19041.00 but SDK reports as requiring 10.0.19041.38
  -->
	<PropertyGroup>
		<WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
		<Nullable>enable</Nullable>
  </PropertyGroup>

To replicate, create a new project, add the nuget packages above and modify mainwindow to include a xaml reference of xmlns:converters="using:CommunityToolkit.WinUI.Converters" - the last portion of (WinUI.Converters) will not be found in the drop down boxes as you type.

Any suggestions on how to fix?

Regression

No response

Steps to reproduce

To replicate, create a new WinUI Blank App (WinUI3 Packaged) project,
Use .Net 8,
Use target of x64 windows only.
Add the nuget packages above into project either by add, copy into .csproj file
Modify mainwindow.xaml to include a xaml reference of
  xmlns:converters="using:CommunityToolkit.WinUI.Converters"

The undefined namespace error will appear as WinUI.Converters portion cannot be found
The error does not go away on build.

Expected behavior

The namspace "CommunityToolkit.WinUI.Converters" should be availabe after CommunityToolkit.WinUI.Converters is installed with nuget

Screenshots

No response

IDE and version

VS 2022

IDE version

4.8.09032

Nuget packages

  • [X] CommunityToolkit.Common
  • [ ] CommunityToolkit.Diagnostics
  • [ ] CommunityToolkit.HighPerformance
  • [X] CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.1.240821

Additional context

No response

Help us help you

Yes, but only if others can assist

RossCoeH avatar Sep 16 '24 08:09 RossCoeH