One of the most important features in building a WinUI Desktop app is proper compilation of XAML files into XBF, and packaging them into PRI files. This process is convoluted and buggy when using the first-party UWP targets. I aim to fix this.
resources.pri
with resources for the main app. No amount of modification to the targets in the above PR causes this to happen. The XBF files are copied as-is into the bin directory, and removing them causes the app to crash. This is because the generated .g.i.cs
files are hardcoded to look for them directly in the filesystem.genxbf.dll
). Presumably this is to ensure 100% backwards compatibility when targeting downlevel versions of Windows 10, but there could be other reasons that I do not know about.
| Capability | Priority |
| :---------- | :------- |
| Create open-source MSBuild tasks (in this repo) that compile XAML to XBF files | Must |
| Create open-source MSBuild tasks (in this repo) that invoke makepri.exe | Must |
| Create open-source MSBuild tasks (in this repo) that generate the .g.i.cs
code-behind files | Must |
| The tasks will support C# apps | Must |
| The tasks will support C++ apps | Must |
| The tasks will support packaging XBF files into PRI files, and loading them at runtime directly from there | Should |
runtimes/win10-x64
subdirectory. This breaks use of Registration-Free WinRT manifest code. I would appreciate it if this could be fixed, although it may be done in a different PR.The {x:Bind}
compiler is even more buggy than xaml that I don't have patience to open separated issue for each bug I found. Please modernize both the experience and infrastructure like Blazor.
@wjk @huoyaoyuan thank you for the awesome feedback! I couldn't agree more, this needs to be addressed. I just created the area-Tooling label so that we can track tooling related improvements.
I don't have anything concrete to share right now, but I am working on a proposal that will move us in the right direction. Once we have something ready to share we can start to get everyone's input. If you have (or see) any tooling related issues please tag or tweet me.
/cc @pag3
"The tasks will support C++ apps" needs to be a must - C++ developers should not be forced to the inferior experience, especially considering it's the same XAML compiler ultimately.
"The tasks will support C++ apps" needs to be a must - C++ developers should not be forced to the inferior experience, especially considering it's the same XAML compiler ultimately.
This includes a proper experience for the IDL files required to bind into XAML, with syntax highlighting and code completion, and no manual copying of generated files.
Updated OP. The only real reason I put that as a "should" was to indicate that (to me) it was of lower priority, and that I was OK if only the C# version shipped first. Now I see I was in error. I absolutely agree with all of the complaints about the C++/XAML experience.
@pjmlp IDL is the responsibility of cppwinrt, this issue is about the XAML compiler. Currently, outside C++-specific codegen bugs, the XAML compiler experience is on par with C#.
@sylveon After killing the productivity we had with C++/CX the responsibility to fix it seems to belong always to someone else.
From C++/WinRT team apparently ISO C++ is to blame and we should now just sit and wait for the day that ISO C++ might support C++/CX features, nice service.
@wjk we have started work on a xaml compiler exe. If you are using Preview2, you can set UseXamlCompilerExecutable
in your project file, this will be used instead of the MSBuild task dll. It's still early on (and why we haven't made it the default yet), so we'd appreciate getting your feedback on it. While the code isn't open source yet, you can probably look through our props/targets in the nuget package to figure out how it's used :)
@sylveon and @pjmlp I think I've said this on a few other threads, but we don't want us to wait for metaclasses support to drop IDL. We can and do want to create a better experience today, we just aren't quite ready to start that work today.
/cc @RealTommyKlein, @Scottj1s, @kennykerr, @JeanRoca
@stevenbrix Thanks for confirming that the productivity loss due to withdrawing C++/CX is taking care of.
If you allow me just a little bit of feedback, C++/CX is almost perfect, finally Microsoft seemed to be getting what it meant to have a C++ RAD offering, which while not yet C++ Builder like, it is almost like there.
Instead of improving what was still missing, versus the .NET experience for UWP applications (C++/CX still required a bit more boilerplate), everything was dropped in name of a ISO C++ compatibility that doesn't matter, when the applications are anyway not portable to anything other than Windows/UWP environment.
Instead we got a developer experience that feels worse than just doing plain old MFC applications, and it is good that the message is no longer that we sit and wait for ISO C++ to someday catch up with C++/CX capabilities from 2012.
Now I have something to look for, and will correct my message in regards to C++/WinRT current state.
It would be nice that whatever is being planned eventually gets announced in some Windows or Visual Studio related blog, so that all that feel the same way see that "developers, developers, developers" also includes WinUI/C++ tooling.
@pjmlp we're so early in discussion, it's mostly just hallway talk at this point (if that were a thing anymore). Once there is something to share, we will. But I wouldn't expect anything in 2020.
I'm glad you are happy with C++/Cx, but for everyone who feels the way you do, someone says they hate it.
Most helpful comment
@wjk we have started work on a xaml compiler exe. If you are using Preview2, you can set
UseXamlCompilerExecutable
in your project file, this will be used instead of the MSBuild task dll. It's still early on (and why we haven't made it the default yet), so we'd appreciate getting your feedback on it. While the code isn't open source yet, you can probably look through our props/targets in the nuget package to figure out how it's used :)@sylveon and @pjmlp I think I've said this on a few other threads, but we don't want us to wait for metaclasses support to drop IDL. We can and do want to create a better experience today, we just aren't quite ready to start that work today.
/cc @RealTommyKlein, @Scottj1s, @kennykerr, @JeanRoca