Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The version of the ‘System. Interactive’ reference file is incorrect #1077

Open
hedandan1989 opened this issue Nov 25, 2024 · 4 comments
Labels
Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project

Comments

@hedandan1989
Copy link

𝗗𝗲𝘀𝗰𝗿𝗶𝗯𝗲 𝘁𝗵𝗲 𝗯𝘂𝗴
An error occurs when updating Model. xafml while using Upload File Property Editor.

------- Updating model differences: Project: C:\Users\hedandan\source\repos\DXApplication4\DXApplication4.Blazor.Server\DXApplication4.Blazor.Server.csproj
Error:
System.BadImageFormatException: Could not load file or assembly 'System.Interactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. Reference assemblies cannot be loaded for execution. (0x80131058)
File name: 'System.Interactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' ---> System.BadImageFormatException: Cannot load a reference assembly for execution.
   at Xpand.XAF.Modules.Reactive.Services.AttributesExtensions.<>c.<InvisibleInAllViewsAttribute>b__15_1(ValueTuple`2[] attributes)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.EnumerableSelector._.OnNext(TSource value)
--- End of stack trace from previous location ---
   at System.Reactive.PlatformServices.ExceptionServicesImpl.Rethrow(Exception exception)
   at System.Reactive.ExceptionHelpers.Throw(Exception exception)
   at System.Reactive.Stubs.<>c.<.cctor>b__2_1(Exception ex)
   at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Catch`2._.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.ThrowImmediate`1.Run(IObserver`1 observer)
   at System.Reactive.BasicProducer`1.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.Linq.ObservableImpl.Catch`2._.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.HalfSerializer.ForwardOnError[T](ISink`1 sink, Exception ex, Int32& wip, Exception& error)
   at System.Reactive.Linq.ObservableImpl.TakeUntil`2._.OnError(Exception ex)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Merge`1.Observables._.InnerObserver.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Sink`2.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Sink`2.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.InnerObserver.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Sink`2.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Sink`2.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Sink`2.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Sink`2.OnError(Exception error)
   at System.Reactive.Sink`1.ForwardOnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.EnumerableSelector._.OnNext(TSource value)
   at System.Reactive.Linq.ObservableImpl.ReturnImmediate`1.Run(IObserver`1 observer)
   at System.Reactive.BasicProducer`1.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.Sink`2.Run(IObservable`1 source)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.EnumerableSelector.Run(_ sink)
   at System.Reactive.Producer`2.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.Sink`2.Run(IObservable`1 source)
   at System.Reactive.Linq.ObservableImpl.IgnoreElements`1.Run(_ sink)
   at System.Reactive.Producer`2.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.Sink`2.Run(IObservable`1 source)
   at System.Reactive.Linq.ObservableImpl.Select`2.Selector.Run(_ sink)
   at System.Reactive.Producer`2.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.Sink`2.Run(IObservable`1 source)
   at System.Reactive.Linq.ObservableImpl.Where`1.Predicate.Run(_ sink)
   at System.Reactive.Producer`2.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.TailRecursiveSink`1.Drain()
   at System.Reactive.TailRecursiveSink`1.Run(IEnumerable`1 sources)
   at System.Reactive.Linq.ObservableImpl.Concat`1.Run(_ sink)
   at System.Reactive.Producer`2.<>c.<SubscribeRaw>b__1_0(ValueTuple`2 tuple)
   at System.Reactive.Concurrency.Scheduler.<>c__75`1.<ScheduleAction>b__75_0(IScheduler _, ValueTuple`2 tuple)
   at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func`3 action)
   at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func`3 action)
   at System.Reactive.Concurrency.Scheduler.ScheduleAction[TState](IScheduler scheduler, TState state, Action`1 action)
   at System.Reactive.Producer`2.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.ObservableExtensions.SubscribeSafe[T](IObservable`1 source, IObserver`1 observer)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.SubscribeInner(IObservable`1 inner)
   at System.Reactive.Linq.ObservableImpl.SelectMany`2.ObservableSelectorIndexed._.OnNext(TSource value)
   at System.Reactive.Sink`1.ForwardOnNext(TTarget value)
   at System.Reactive.Linq.ObservableImpl.Select`2.Selector._.OnNext(TSource value)
   at System.Reactive.Sink`1.ForwardOnNext(TTarget value)
   at System.Reactive.Linq.ObservableImpl.Select`2.Selector._.OnNext(TSource value)
   at System.Reactive.Subjects.Subject`1.OnNext(T value)
   at System.Reactive.Linq.ObservableImpl.FromEventPattern.Impl`2.<>c__DisplayClass3_0.<GetHandler>b__0(Object sender, TEventArgs eventArgs)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at DevExpress.ExpressApp.ApplicationModulesManager.OnCustomizeTypesInfo(ITypesInfo typesInfo)
   at DevExpress.ExpressApp.ApplicationModulesManager.DoCustomizeTypesInfo(ITypesInfo typesInfo)
   at DevExpress.ExpressApp.ApplicationModulesManager.LoadTypesInfo(ITypesInfo typesInfo)
   at DevExpress.ExpressApp.ApplicationModulesManager.Load(ITypesInfo typesInfo, Boolean loadTypesInfo)
   at DevExpress.ExpressApp.Utils.DesignerModelFactory.CreateModulesManager(XafApplication application, String configFileName, String assembliesPath, Action initializeTypeInfoSources)
   at DevExpress.ExpressApp.Design.ModelUpdater.UpdateModel(ProjectReference projectReference)
   at DevExpress.ExpressApp.Design.ModelUpdater.UpdateModel(ModelUpdater modelUpdater, ProjectReference projectReference, OutputWindowPane outputWindow)
Update failed

𝗧𝗼 𝗥𝗲𝗽𝗿𝗼𝗱𝘂𝗰𝗲

  1. Add a NUGET reference to the DXApplication4.Blazor. Server project
  2. Add assembly reference to Program.cs
[assembly: HostingStartup(typeof(Xpand.Extensions.Blazor.HostingStartup))]
[assembly: HostingStartup(typeof(Xpand.XAF.Modules.Blazor.BlazorStartup))]
namespace DXApplication4.Blazor.Server;
  1. Add BlazorModule reference to module.cs in the Blazor project
    RequiredModuleTypes.Add(typeof(Xpand.XAF.Modules.Blazor.BlazorModule));
  2. Generate project
  3. Right click on the blazor.server project and click on update model
    𝗘𝘅𝗽𝗲𝗰𝘁𝗲𝗱 𝗯𝗲𝗵𝗮𝘃𝗶𝗼𝗿
    Unable to find file version 5.0.0.0 in the error message, but the compiled file version is 5.0.0.1
    𝗦𝗰𝗿𝗲𝗲𝗻𝘀𝗵𝗼𝘁𝘀
    image

Here is he demo.
DXApplication4.zip

@hedandan1989 hedandan1989 added Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project labels Nov 25, 2024
@apobekiaris
Copy link
Member

<PackageReference Include="System.Interactive" Version="6.0.1" />
<PackageReference Include="System.Interactive.Async" Version="6.0.1" />

add it in your Blazor project and let me know if it worked

@yunits
Copy link

yunits commented Nov 29, 2024

after adding these packages to your project rebuild your solution.
To see Model Editor again you also need restart visual studio

@hedandan1989
Copy link
Author

Thank you.
After installing specific packages, there were no more error messages. But a new issue arose, the uploadpropertyeditor was not displayed in model.xafml, and even if I specified the editor in the code, it still wouldn't work. After opening the page, it is still a regular listview.

here is the code.
`[DefaultClassOptions]
[DefaultProperty(nameof(Name))]
public class Emplyee : BaseObject
{
public Emplyee(Session session) : base(session)
{ }

string fName;

[Size(SizeAttribute.DefaultStringMappingFieldSize)]
public string Name
{
    get => fName;
    set => SetPropertyValue(nameof(Name), ref fName, value);
}

[PersistentAlias("EmployeeDatas.Count")]
[EditorAlias(nameof(DisplayTextPropertyEditor))]
public int FileCount => (int)EvaluateAlias();

[Association("Emplyee-EmployeeDatas")]
[EditorAlias("UploadFilePropertyEditor")]
public XPCollection<EmployeeFileData> EmployeeDatas
{
    get
    {
        return GetCollection<EmployeeFileData>(nameof(EmployeeDatas));
    }
}

}

//[DefaultClassOptions]
public class EmployeeFileData : FileData
{
public EmployeeFileData(Session session) : base(session)
{ }

Emplyee fEmployee;

[Association("Emplyee-EmployeeDatas")]
public Emplyee Employee
{
    get => fEmployee;
    set => SetPropertyValue(nameof(Employee), ref fEmployee, value);
}

}`

here is the screenshot,there is no uploadpropertyeditor.
image

here is the sample.
DXApplication5.zip

@apobekiaris
Copy link
Member

probably some breaking change in the Xaf code or improvment. In any case you can workaround it like

public IEnumerable<IFileData> Datas => EmployeeDatas;

also if u have the time u can create your custom editor without any implementation mark it with [PropertyEditor(typeof(IEnumerable<IFileData>),EditorAliases.UploadFile, false)], create a sample and ask in DX support center explaining to them that the time I recorded the video in the wiki it was working

@apobekiaris apobekiaris removed their assignment Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project
Projects
None yet
Development

No branches or pull requests

3 participants