Reactiveui: [BUG] 9.14.3 thows exception in UWP - You are referencing the Portable version of ReactiveUI in an App

Created on 13 May 2019  Â·  6Comments  Â·  Source: reactiveui/ReactiveUI

Describe the bug

Using 9.14.3 in UWP project throw following exception

  | Name | Value | Type
-- | -- | -- | --
â–¶ | e | {System.TypeInitializationException: The type initializer for 'ReactiveUI.RxApp' threw an exception. ---> System.Exception: You are referencing the Portable version of ReactiveUI in an App. Please change your reference to the specific version for your platform found here: https://reactiveui.net/docs/getting-started/installation/nuget-packages at ReactiveUI.PlatformRegistrations.Register(Action2 registerFunction) in d:\a\1\s\src\ReactiveUI\Platforms\netstandard2.0\PlatformRegistrations.cs:line 19 at ReactiveUI.DependencyResolverMixins.InitializeReactiveUI(IMutableDependencyResolver resolver) in d:\a\1\s\src\ReactiveUI\Mixins\DependencyResolverMixins.cs:line 39 at ReactiveUI.RxApp.<>c.<.cctor>b__11_0() in d:\a\1\s\src\ReactiveUI\RxApp.cs:line 97 at Splat.InternalLocator.RegisterResolverCallbackChanged(Action callback) in d:\a\1\s\src\Splat\ServiceLocation\InternalLocator.cs:line 117 at Splat.Locator.RegisterResolverCallbackChanged(Action callback) in d:\a\1\s\src\Splat\ServiceLocation\Locator.cs:line 69 at ReactiveUI.RxApp..cctor() in d:\a\1\s\src\ReactiveUI\RxApp.cs:line 90 --- End of inner exception stack trace --- at ReactiveUI.ReactiveCommand.Create[TParam,TResult](Func2 execute, IObservable`1 canExecute, IScheduler outputScheduler) in d:\a\1\s\src\ReactiveUI\ReactiveCommand\ReactiveCommand.cs:line 230 at App3.ViewModels.ShareTargetViewModel..ctor()} | System.Exception {System.TypeInitializationException}

9.13.1 is working though.

Steps To Reproduce
Include Reactive.UI.Fody to UWP project

Environment

  • OS: Windows 10
  • Version 1803
  • Device: Desktop
bug outdated

Most helpful comment

Our minimum requirement for UWP is 10.0.17763.0

You should change

<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>

to

<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>

All 6 comments

Hi there,

Do you have a sample app you can provide at all?

Thanks.

Sure, I will try to reproduce with bare minimum code. I used the latest WTS and added a ReactiveUI.Fody package. Any invocation leads to that error. I will update the issue, as soon I reproduce it with a small WTS project.

@glennawatson I have added a sample app on github ReactiveUITestApp1
The target is 1809 with min target of 1803. The OS is 1803. I am using Visual Studio 2019, with WTS (3.2).

Version 9.14.1
When I create the ReactiveCommand in the ctor of MainViewModel the exception is thrown.

Version 9.12.1
The exception goes away.

I tried to reproduce it with blank UWP app, I failed to reproduce it. Not sure what is it that WTS adds that causes this issue.

Our minimum requirement for UWP is 10.0.17763.0

You should change

<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>

to

<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>

I tested with your test application with the changes recommend above. Your application doesn't crash so closing this issue.

If you have the sdk numbers installed and still doesn't work, then you might want to upgrade your win10, if it wasn't done in a while.

Was this page helpful?
0 / 5 - 0 ratings