Closed ss-carlo closed 1 year ago
post your sample
The pre-release 4.222.2.0 in the Reactive.XAF lab
branch includes commits that relate to this task:
To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.
If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.
Thanks a lot for your contribution.
Hi @apobekiaris,
I have updated my DevExpress version to 22.2.4 to be able to use the pre-release Nuget packages. I also used the Xpand.XAF.Core.All and Xpand.XAF.Web.All as recommended but it still did not fix the issue. It actually made the Blazor application crash when I try to navigate into the JobScheduler menu Sample Video
Here is the new error message: `The error occurred:
Type: ArgumentNullException
Message: Value cannot be null. (Parameter 'context')
Data: 0 entries
Stack trace:
at System.Reactive.Linq.Observable.ObserveOn[TSource](IObservable1 source, SynchronizationContext context) in /_/Rx.NET/Source/src/System.Reactive/Linq/Observable.Concurrency.cs:line 62 at Xpand.XAF.Modules.Reactive.Services.XafApplicationRxExtensions.WhenWindowCreated(XafApplication application, Boolean isMain, Boolean emitIfMainExists) at Xpand.XAF.Modules.Reactive.Services.XafApplicationRxExtensions.WhenSynchronizationContext(XafApplication application) at Xpand.XAF.Modules.Reactive.Services.ShowMessageExtensions.ShowMessages(XafApplication application) at Xpand.XAF.Modules.Reactive.RxApp.Connect(XafApplication application) at Xpand.XAF.Modules.Reactive.RxApp.<>c__DisplayClass12_0.<Connect>b__0(XafApplication application) at System.Reactive.Linq.ObservableImpl.Defer
1..Run() in //Rx.NET/Source/src/System.Reactive/Linq/Observable/Defer.cs:line 37
InnerException is null`
Thanks
Using the next
minor I did:
<PackageReference Include="Xpand.XAF.Modules.JobScheduler.Hangfire" Version="4.222.2.1" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
BlazorModule.cs
[assembly: HostingStartup(typeof(HostingStartup))] [assembly: HostingStartup(typeof(HangfireStartup))] [assembly: HostingStartup(typeof(Xpand.XAF.Modules.Blazor.BlazorStartup))] namespace DXApplication26.Blazor.Server;
[JobProvider] public class Job { public IServiceProvider ServiceProvider { get; } public Job() { } [ActivatorUtilitiesConstructor] public Job(IServiceProvider provider) => ServiceProvider = provider;
[JobProvider]
public async Task<bool> ImportOrders()
=> await ServiceProvider.RunWithStorageAsync(application => Observable.Using(
() => application.CreateNonSecuredObjectSpace(typeof(Order)),objectSpace
=> Observable.Range(0, 10).Do(i => {
var order = objectSpace.CreateObject<Order>();
order.OrderID = i;
}).Finally(objectSpace.CommitChanges)).To(true));
public void Failed() {
throw new NotImplementedException();
}
}
public class Order:BaseObject { public Order(Session session) : base(session) { }
int _orderID;
public int OrderID {
get => _orderID;
set => SetPropertyValue(nameof(OrderID), ref _orderID, value);
}
}
4. In the same file
```cs
public DXApplication26BlazorModule() {
RequiredModuleTypes.Add(typeof(JobSchedulerModule));
}
public override void AddGeneratorUpdaters(ModelNodesGeneratorUpdaters updaters) {
base.AddGeneratorUpdaters(updaters);
updaters.Add(new JoSchedulerSourceUpdater());
}
GlobalConfiguration.Configuration.UseMemoryStorage();
Doing so I was able to create and trigger a new job and open the Workers tab.
The pre-release 4.222.2.0 in the Reactive.XAF lab
branch includes commits that relate to this task:
To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.
If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.
Thanks a lot for your contribution.
Using the
next
minor I did:
- New Wizard Blazor solution
- Add the next in the blazor project
<PackageReference Include="Xpand.XAF.Modules.JobScheduler.Hangfire" Version="4.222.2.1" /> <PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
- Added the next in the
BlazorModule.cs
[assembly: HostingStartup(typeof(HostingStartup))] [assembly: HostingStartup(typeof(HangfireStartup))] [assembly: HostingStartup(typeof(Xpand.XAF.Modules.Blazor.BlazorStartup))] namespace DXApplication26.Blazor.Server; [JobProvider] public class Job { public IServiceProvider ServiceProvider { get; } public Job() { } [ActivatorUtilitiesConstructor] public Job(IServiceProvider provider) => ServiceProvider = provider; [JobProvider] public async Task<bool> ImportOrders() => await ServiceProvider.RunWithStorageAsync(application => Observable.Using( () => application.CreateNonSecuredObjectSpace(typeof(Order)),objectSpace => Observable.Range(0, 10).Do(i => { var order = objectSpace.CreateObject<Order>(); order.OrderID = i; }).Finally(objectSpace.CommitChanges)).To(true)); public void Failed() { throw new NotImplementedException(); } } public class Order:BaseObject { public Order(Session session) : base(session) { } int _orderID; public int OrderID { get => _orderID; set => SetPropertyValue(nameof(OrderID), ref _orderID, value); } }
- In the same file
public DXApplication26BlazorModule() { RequiredModuleTypes.Add(typeof(JobSchedulerModule)); } public override void AddGeneratorUpdaters(ModelNodesGeneratorUpdaters updaters) { base.AddGeneratorUpdaters(updaters); updaters.Add(new JoSchedulerSourceUpdater()); }
- Setup a Hangfire storage in Startup.cs
GlobalConfiguration.Configuration.UseMemoryStorage();
Doing so I was able to create and trigger a new job and open the Workers tab.
Thanks, I can confirm that this minor version fixes the issue!
Hi,
While in the details view of the Hangfire Job, when I try to open the Workers tab, the application suddenly crashes with the following error message:
`The error occurred:
at Xpand.XAF.Modules.Reactive.Services.AttributesExtensions.<>c.b__24(ValueTuple
2 t) at System.Linq.EnumerableEx.DoCore[TSource](IEnumerable
1 source, Action1 onNext, Action
1 onError, Action onCompleted)+MoveNext() in //Ix.NET/Source/System.Interactive/System/Linq/Operators/Do.cs:line 129 at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Reactive.Linq.ObservableImpl.SelectMany
2.EnumerableSelector..OnNext(TSource value) in //Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs:line 1361 InnerException is null`Sample video: https://user-images.githubusercontent.com/55209461/217061893-595240bd-0760-45ec-ad51-8da3930ea95c.mp4