Closed Mysterious-Dev closed 1 year ago
Not sure how this passed the validation build. I figured this was a breaking change, but the validation build said OK. However when I went to publish this, it did indeed fail:
C:\Users\runneradmin\.nuget\packages\microsoft.dotnet.packagevalidation\1.0.0-preview.7.21379.12\build\Microsoft.DotNet.PackageValidation.targets(22,5): error CP0002: Member 'WinUIEx.WindowEx.Title.set' exists on [Baseline] lib/net6.0-windows10.0.18362/WinUIEx.dll but not on lib/net6.0-windows10.0.18362/WinUIEx.dll [D:\a\WinUIEx\WinUIEx\src\WinUIEx\WinUIEx.csproj]
This makes WinUIEx incompatible with .NET7.0+MAUI https://github.com/dotnet/maui/issues/14107
Not following. That issue says to explicitly reference 1.3 of WinAppSDK. That’s just how nuget and dependencies work.
This worked fine for me:
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PackageReference Include="WinUIEx" Version="2.2.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230502000" />
</ItemGroup>
Note that you might have to restart VS if you get a PrecompiledHeader exception after upgrading WindowsAppSDK due to a known bug in 1.3
Oh! Awesome, thank you so much. I had thought I just couldn't upgrade because of the PrecompiledHeader exception. I'll restart VS.
Yeah it’s an annoying bug. I was told at build that it’s fixed and should be ready in the next patch
I still have this issue (Visual Studio 17.6.4, MAUI, net7.0-windows10.0.19041.0)
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
</ItemGroup>
and when I try to publish:
1>Determining projects to restore...
1>A PackageReference for 'Microsoft.WindowsAppSDK' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs
[cut]
1>Improper project configuration: WindowsPackageType is set to None, but PublishAppxPackage is set to true.
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
========== Publish started at 3:30 PM and took 20,134 seconds ==========
========== Package: 0 succeeded, 1 failed ===========
The error message tells me this is a project configuration issue and has nothing to do with WinUIEx
I haven't wrote anything about WinUIEx. the issue is about the need to upgrade Microsoft.WindowsAppSDK to 1.3 or above, due to the error: https://github.com/dotnet/maui/issues/10102
@Magic73 but this repo is for WinUIEx
DOH :( you're right. sorry
Hello, I got the same issue, as per the suggestions i added the below code,
<ItemGroup Condition="'$(TargetFramework)'=='net7.0-windows10.0.20348.0'"> <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230331000" /> </ItemGroup>
after adding the bove one also not able to publish the app package for the windows platform.
Here is my target platforms:
<TargetFrameworks>net7.0-ios;net7.0-android33.0</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.20348.0</TargetFrameworks>
Can some one suggest something to make it work. I don't see any possible sollution in the internet.
Your windows condition for the package reference doesn't match the target framework you actually compile for (different windows sdk versions)
@dotMorten thanks for that, I tried the matching sdk as well like below
`
`
`
`
But no luck.
ok. An old closed PR in a repo that isn't Maui or Windows App SDK repo probably isn't the right place to be trouble-shooting this though.
@dotMorten which repo you are talking about? Is there a way can get the fix for this? Or any suggestions?
I don't see anything in the little bit of information you provided to indicate you're dealing with an issue in WinUIEx, which is the only thing that belongs here. I don't have enough information either to point you to where to go, but again this isn't the place for this. Perhaps try the Microsoft community forums first and include as much information as possible including a simple sample that reproduces the issue
All is in the title ^^.