Closed acouvert-msft closed 3 months ago
There is some issues for class library, i also reported another issue here https://github.com/microsoft/WindowsAppSDK/issues/4567
I can bypass my issue with changing platform from anycpu to x86 or x64 so give it a try and change your class library platform to x64 or x86
I'm currently experiencing the issue when targeting x86 / x64 / ARM64. @ghost1372 could you share your project file so I could compare what you are doing different? Thanks.
For the records, I'm attaching my projects before and after the updates. OK_TestCSharpWinrRTComponent_v1.5.zip KO_TestCSharpWinrRTComponent_v1.6-exp2.zip
Just to ask, have you tried this with CsWinRT 2.1.0 preview?
@DarranRowe I tried with CsWinRT 2.1.0-prerelease.240715.1
and latest WindowsAppSDK 1.6.240722000-experimental2
with the same result.
@DarranRowe I tried with
CsWinRT 2.1.0-prerelease.240715.1
and latestWindowsAppSDK 1.6.240722000-experimental2
with the same result.
I tested your sample and unfortunately I did not find any solution for it. Class library has many problems. Just a few moments ago, I reported another problem related to the publish single file
This is due to a change in experimental 2 where GeneratedFilesDir
is getting set to a relative path rather than an absolute path.
Tracked internally via https://task.ms/52711016
The internal bug is named: 'wv2winrt.targets' incorrectly overrides 'GeneratedFilesDir' to be the top-level project folder
Until the WebView2 nupkg is published with this fix, you can workaround it by setting GeneratedFilesDir early in the project.
Closing for now, thanks!
Describe the bug
I have a project that creates a C# component with WinUI 3 controls that I consume from a C++/WinRT app that uses the Windows App SDK. I followed the instructions: Walkthrough—Create a C# component with WinUI 3 controls, and consume it from a C++/WinRT app that uses the Windows App SDK with some minor changes (targeting .net6, minimum Windows version 10.0.19041, x64 and ARM64 platforms).
Initially the C# component project is depending on
Microsoft.WindowsAppSDK 1.5.240311000
. It can build and be consumed as expected.Updating the C# component project to
Microsoft.WindowsAppSDK 1.6.240701003-experimental2
results in build issue.Steps to reproduce the bug
Create a C# ClassLibrary project as bellow:
Build successfully ✅
Update
Microsoft.WindowsAppSDK
to1.6.240701003-experimental2
. Build and get the following error 🚩Address the error by adding
<WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion>
..csproj
is now:Build and get the following error 🚩
Expected behavior
I should be able to update to latest
Microsoft.WindowsAppSDK
without build issue.Screenshots
No response
NuGet package version
Windows App SDK 1.6 Experimental 2: 1.6.240701003-experimental2
Packaging type
No response
Windows version
No response
IDE
Visual Studio 2022
Additional context
The C# project is only containing a simple XAML control: