reactiveui / ReactiveUI

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
https://www.reactiveui.net
MIT License
8.1k stars 1.12k forks source link

[BUG] Adding ReactiveUI.Events to base empty UWP causes `Compile with .Net Native tool chain` build option to fail #2312

Closed matthewacme closed 3 years ago

matthewacme commented 4 years ago

Description Adding the ReactiveUI.Events Nuget package 11.1.n to a newly created empty UWP app in Visual Studio using the base no frills template will cause the release build to fail if Compile with .NET Native tool chain compiler option is set to true.

This option must be set to true in order to be able to submit a UWP to the store.

Steps To Reproduce

Screen shots for each step included below

  1. Open Visual Studio 2019 and select to create a Universal Windows Blank App
  2. Select target version of 18362 and min ver of 17134
  3. open project properties and set the build to Release | x64 and make sure the Compile with .NET Native tool chain option is selected true (this is the default)
  4. Run app to confirm hello world works
  5. open Nuget for solution and add ReactiveUI.Events package 11.1.6 (error will also happen with 11.1.1 package)
  6. add ReactiveUI base package 11.1.6
  7. Try to run / compile the application now, it will fail with SDK ...nutc_driver.exe returned with exit code 1
  8. Remove the ReactiveUI.Events nuget package from the application, leaving in the ReactiveUI base package
  9. Application compiles and runs.

Expected behavior The project should build and run with just a reference to the nuget package with the Compile with .NET Native tool chain compiler option set to on.

Screenshots

  1. image

  2. image

  3. image

  4. image

  5. image

  6. image

  7. image

  8. image

  9. image

Environment image

-OS Name Microsoft Windows 10 Pro -Version 10.0.18363 Build 18363 -Other OS Description Not Available -OS Manufacturer Microsoft Corporation -System Name XSGEEKBOOK -System Manufacturer Microsoft Corporation -System Model Surface Book 2 -System Type x64-based PC -System SKU Surface_Book_1793 -Processor Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz, 2112 Mhz, 4 Core(s), 8 Logical Processor(s) -BIOS Version/Date Microsoft Corporation 389.2837.768, 8/21/2019 -SMBIOS Version 3.1 -Embedded Controller Version 255.255 -BIOS Mode UEFI -BaseBoard Manufacturer Microsoft Corporation -BaseBoard Product Surface Book 2 -BaseBoard Version Not Available -Platform Role Slate -Secure Boot State On -PCR7 Configuration Elevation Required to View -Windows Directory C:\WINDOWS -System Directory C:\WINDOWS\system32 -Boot Device \Device\HarddiskVolume1 -Locale United States -Hardware Abstraction Layer Version = "10.0.18362.387" -User Name XSGEEKBOOK\mh -Time Zone Eastern Standard Time -Installed Physical Memory (RAM) 16.0 GB -Total Physical Memory 15.9 GB -Available Physical Memory 6.34 GB -Total Virtual Memory 25.4 GB -Available Virtual Memory 12.2 GB -Page File Space 9.50 GB -Page File C:\pagefile.sys -Kernel DMA Protection Not Available -Virtualization-based security Running -Virtualization-based security Required Security Properties -Virtualization-based security Available Security Properties Base Virtualization Support, Secure Boot, DMA Protection, UEFI Code Readonly, SMM Security Mitigations 1.0, Mode Based Execution Control -Virtualization-based security Services Configured
-Virtualization-based security Services Running -Device Encryption Support Elevation Required to View -A hypervisor has been detected. Features required for Hyper-V will not be displayed.

Visual Studio Configuration Microsoft Visual Studio Professional 2019 Version 16.4.3 VisualStudio.16.Release/16.4.3+29709.97 Microsoft .NET Framework Version 4.8.03752

Installed Version: Professional

Visual C++ 2019 00435-60000-00000-AA931 Microsoft Visual C++ 2019

.ignore 1.2.77 A language service that makes it painless to handle all types of .ignore files such as .gitignore, .tfignore, etc.

Add New File 3.5.138 The fastest and easiest way to add new files to any project - including files that start with a dot

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 2019 16.4.457.38025 ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2012 16.4.457.38025 For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2019 16.4.457.38025 For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.4.457.38025 Azure App Service Tools v3.0.0

Azure Data Lake Node 1.0 This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio 2.4.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 16.4.457.38025 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.4.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 3.4.1-beta4-19610-02+c4e5d138903b899477649a17f197abd2bcb22f9e C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents 1.0 Fabric Diagnostic Events

Farticus 2.0.3 The original Visual Studio fart app

Git Tools 2019 3.1.1 This extension provides a git changes window, and menus to launch Git Bash, Git Extenstions and TortoiseGit.

GitHub.VisualStudio 2.10.8.8132 A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IncrediBuild Build Acceleration 1.5.0.10 IncrediBuild effectively reduces compilation and development times by up to 90%.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Material icons generator 1.8.60 This plugin help you to add material design icons to your Android, iOS or UWP project

Microsoft Azure HDInsight Azure Node 2.4.5000.0 HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service 2.4.5000.0 Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio 16.0 Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service 2.4.5000.0 Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node 1.0 Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.21016.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.0.87+gbb515bf382 Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.5.24 (1fafd7e) Support for debugging Mono processes with Visual Studio.

Multilingual App Toolkit 4.0 Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://aka.ms/matinstall

NuGet Package Manager 5.4.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

SendMeThatPackage Extension 1.0 SendMeThatPackage Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.61912.09160 Microsoft SQL Server Data Tools

StopOnFirstBuildError 1.0 StopOnFirstBuildError

Stops a solution build immediately after a project has failed to build.

http://tech.einaregilsson.com/2011/01/06/stop-build-on-first-error-in-visual-studio-2010/

StylerPackage Extension 1.0 StylerPackage Visual Stuido Extension Detailed Info

Surface Dial Tools for Visual Studio 0.8.68 Adds features to Visual Studio specific to the Surface Dial. You don't need a Surface Book or Surface Studio to take advantage of the Surface Dial.

Syntax Visualizer 1.0 An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 16.0.11031.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.4.1-beta4-19610-02+c4e5d138903b899477649a17f197abd2bcb22f9e Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Cross Platform Mobile Development (Android) 16.0.29428.195 Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Linux Development 1.0.9.29512 Visual C++ for Linux Development

Visual F# Tools 10.4 for F# 4.6 16.4.0-beta.19556.5+e7597deb7042710a7142bdccabd6f92b0840d354 Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0 View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake

Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes 1.0 Visual Studio Tools for Kubernetes

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Windows Template Studio 3.5.19310.1 Windows Template Studio quickly builds a UWP app, using a wizard-based UI to turn your needs into a foundation of Windows 10 patterns and best practices.

Xamarin 16.4.000.308 (d16-4@4755fb3) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.4.0.475 (remotes/origin/d16-4@ac250f5aa) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.4.25 (579ee62) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.1.3.7 (d16-4/d66aed0) Xamarin.Android Reference Assemblies and MSBuild support. Mono: fd9f379 Java.Interop: xamarin/java.interop/d16-4@c4e569f ProGuard: xamarin/proguard/master@905836d SQLite: xamarin/sqlite/3.28.0@46204c4 Xamarin.Android Tools: xamarin/xamarin-android-tools/master@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK 13.10.0.17 (5f802ef) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

matthewacme commented 4 years ago

Update,

Just discovered that the compile error happens ONLY when BOTH ReactiveUI and ReactiveUI.Events nuget packages are both included in at least one project.

Either one by themselves in a project and the app will compile and run no problem

TangoSensory commented 4 years ago

Hitting the same issue. Any update?

matthewacme commented 4 years ago

Considering I opened this bug 8 months ago, and no one has even looked at it, I'm not sure we can expect any of the project developers have time to fix things.

glennawatson commented 4 years ago

We have reduced bugs by 30 so far in the last couple months with priority for those who have sponsored the project.

TangoSensory commented 4 years ago

We have reduced bugs by 30 so far in the last couple months with priority for those who have sponsored the project.

Ok. Appreciate your efforts. Thanks.

This seems like quite a fundamental issue for anyone using UWP though. Would be grateful if you could take a look. Thanks

glennawatson commented 4 years ago

But yeah this is likely due to version mismatch with the generated events on pharmacist which is something I have been working on in other issues. So hopefully fixed in the next couple weeks. By default at the moment it's generating for 16299 only of uwp

matthewacme commented 4 years ago

@glennawatson Fair enough... I can understand that totally, we all need to pay our bills. After all I used to buy tools from Telerik and they'd take up to a year to fix bugs sometimes, you guys are doing this work "for free" so to speak.

matthewacme commented 4 years ago

Seems only fair for me to contribute to your excellent efforts. So Acme AtronOmatic, LLC has become a monthly backer. I'll talk to the boss and see if I can get a higher monthly donation approved (I have a very low company spending limit).

Thanks folks, my earlier comment was unfair in tone. cc @glennawatson

glennawatson commented 4 years ago

All good. No stress on amount. Anyway wont be immediate but will work on a fix in the next couple weeks.

In the mean time a workaround is you can use the code generated by pharmacist and the events package for the specific events you want to register to.

glennawatson commented 4 years ago

I'll put the generated cs file here in the issue so you can pick and choose your events and bring it across

TangoSensory commented 4 years ago

But yeah this is likely due to version mismatch with the generated events on pharmacist which is something I have been working on in other issues. So hopefully fixed in the next couple weeks. By default at the moment it's generating for 16299 only of uwp

@glennawatson FYI it appears to be affecting versions post 16299 as well. Checking/unchecking "Compile with .NET Native tool chain" (for Release builds), means the build fails/succeeds respectively. I've seen Out-of-memory errors building locally and on Azure, which probably explain why the builds just seem to hang for several minutes before failing

TangoSensory commented 4 years ago

@glennawatson Sensory are now projects backers as well. Thanks for the great work

glennawatson commented 4 years ago

Events_uwp.zip

Attached is the events file that is generated.

I suspect if you just cut it down to the classes/files you are using events for it'll get around your memory issues.

TangoSensory commented 4 years ago

Events_uwp.zip

Attached is the events file that is generated.

I suspect if you just cut it down to the classes/files you are using events for it'll get around your memory issues.

@glennawatson Thanks for the sending that over. Seeing lots of errors though, when including the file. Type not found and type forwarder errors.

Am I right in thinking this will relate to a specific Windows version (via the Reference Assemblies)? If so, which one is this please?

glennawatson commented 4 years ago

I think the problem is that the events at the moment include every single UWP library. Likely what I'm going to do is separate it out into different nuget packages and then lazy loading will take care of those that you don't include.

So my recommendation is until I get a fix is you just cut/paste the relevant generated events for classes in the UWP libraries for the moment.

TangoSensory commented 4 years ago

I think the problem is that the events at the moment include every single UWP library. Likely what I'm going to do is separate it out into different nuget packages and then lazy loading will take care of those that you don't include.

Sounds good. Cheers

So my recommendation is until I get a fix is you just cut/paste the relevant generated events for classes in the UWP libraries for the moment.

Not so keen on this option, but ok, thanks

glennawatson commented 4 years ago

Also you can try the 64 bit linker btw.

The default native compiler is 32 bit and runs out of memory. Add <Use64Bitcompiler>true</Use64Bitcompiler> to the project file as a property option.

glennawatson commented 4 years ago

Looks like you have a different error @behroozbc and not even sure if it is the events packages.

glennawatson commented 4 years ago

Btw for the reference in regards to this issue I believe the solution is two fold.

One is the 64 bit compiler will get around people's issue in the short term. It should compile in 64 bit mode.

Been working on a source generator which will only generate events on classes you call Events() on.

glennawatson commented 4 years ago

@behroozbc since this is unrelated to the current issue can you make a new one and I'll take a look later today for you.

glennawatson commented 3 years ago

Consider using https://github.com/reactivemarbles/observableevents

GitHub
GitHub - reactivemarbles/ObservableEvents
Contribute to reactivemarbles/ObservableEvents development by creating an account on GitHub.
matthewacme commented 3 years ago

So @glennawatson ,

Looking over the ReactiveMarbles project you are suggesting we switch to... I see you are the sole contributor on that project. Does this indicate that the ReactiveUI team will no longer attempt to make ReactiveUI.Events a working nuget package? or is there another reason that the reactivemarbles/observableevents can't be ported to ReactiveUI.Events? Is there incompatiblity in the libraries I should be concerned with?

Also does this indicate the ReactiveUI project is entering a period of fragmentation, where we can expect different parts to be split among different / new proejcts?

glennawatson commented 3 years ago

Reactive marbles project is where all new rxui based projects go. You'll notice we have a number of projects happening over there mostly about using source generators.

We aren't supporting events going forward mostly due to nuget versions not matching and we'd get support issues where dll wouldn't match. Also events is overly agreesive and users would have failed store submissions due to API being included that the stores didn't expect.

matthewacme commented 3 years ago

Thanks for that advice.

I’ll add the marbles to my git areas to watch…

Matthew

@. Matthew C. Hintzen | Windows Washer • w – @. p – 321.234.8839 • MyRadar.com AcmeAom.com

From: Glenn @.> Sent: Saturday, August 21, 2021 11:17 To: reactiveui/ReactiveUI @.> Cc: Matthew Hintzen @.>; Author @.> Subject: Re: [reactiveui/ReactiveUI] [BUG] Adding ReactiveUI.Events to base empty UWP causes Compile with .Net Native tool chain build option to fail (#2312)

Reactive marbles project is where all new rxui based projects go. You'll notice we have a number of projects happening over there mostly about using source generators.

We aren't supporting events going forward mostly due to nuget versions not matching and we'd get support issues where dll wouldn't match. Also events is overly agreesive and users would have failed store submissions due to API being included that the stores didn't expect.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/reactiveui/ReactiveUI/issues/2312#issuecomment-903131714, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACVGS2ECURNKLZMBLNZCJGDT567NBANCNFSM4KHIB5BQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.