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

Visual Studio Model Editor not working due to ModelMapper module #488

Closed
krombipils opened this issue Aug 6, 2019 · 28 comments
Closed

Visual Studio Model Editor not working due to ModelMapper module #488

krombipils opened this issue Aug 6, 2019 · 28 comments
Labels
Bug ModelMapper Reactive.XAF eXpandFrameowrk/DevExpress.XAF project

Comments

@krombipils
Copy link

Currently the ModelMapper does not support the Visual Studio Model Editor. However you can use the XpandModelEditor found in the Xpand.VSIX package. Note that the XpandModelEditor is embedded and version agnostic so its one time only installation.

It took me quite a while to realize that the Visual Studio Model Editor is not working anymore due to issues in the ModelMapper module. Do you have any plans to fix these issues? At least a better error message should be shown.

I also noticed, that the 'Merge User Model...' command is not working anymore since I upgraded from 19.1.3 to 19.1.5. Is this caused by the same issue? Is there any alternative in the XpandModelEditor?

@apobekiaris
Copy link
Member

At least a better error message should be shown.

do u have any suggestions? why this message is not clear?

I also noticed, that the 'Merge User Model...'

probably an additional action could resolve this case, I will update u again.

Do you have any plans to fix these issues?

VS insanity is really costly I thought it might be possible to avoid it, I might reconsider this desicion.

@krombipils
Copy link
Author

do u have any suggestions? why this message is not clear?

Sometimes the VS Model Editor complains about being unable to load "System.Interactive, Version=3.2.0.0" at Xpand.XAF.Modules.ModelMapper.Services.ModelExtendingService.AddExtenders(ModelInterfaceExtenders extenders)
and sometimes the PredefinedMapService tells me to add ModelMapperModule to the RequiredModuleTypes, although it is already added (I guess this happens, because the static Init() method is not executed, when running VS Model Editor).

It was not clear for me, that nothing is wrong with my setup and it is just not possible to use the VS Model Editor anymore. I'm not sure whether it is possible to check if the VS Model Editor is running and throw an InvalidOperationException("Use XpandModelEditor!!!") in this case?!


probably an additional action could resolve this case, I will update u again.

Great!


VS insanity is really costly I thought it might be possible to avoid it, I might reconsider this desicion.

If you find an alternative for Merge User Model and also display a nice error message when trying to use the default VS ModelEditor, using the XpandModelEditor is absolutely fine for me!

@apobekiaris
Copy link
Member

both the action and the message is possible, I still not sure where to spent resources though.

because the static Init() method is not executed, when running VS Model Editor)

I am interested in this comment, can u elab a bit more. What makes u say that a static contructor is not called?

@krombipils
Copy link
Author

I still not sure where to spent resources though.

Right now in my development setup, a SuperUser customizes ListViews/DetailViews and sends me the Model.User.xafml to merge in the changes into our different modules xafmls. Of course it is also possible to merge changes with a texteditor, but this is really an annoying job. Therefore I really would like to use the 'Merge User Model...' action again.


What makes u say that a static contructor is not called?

I guess you are right: The static constructor should be called always. Probably I attached the Debugger to late. Nevertheless the various static Assembly fields (_xafWinAssembly, ...) are null and therefore the error is thrown.

@apobekiaris
Copy link
Member

Right now in my development setup, a SuperUser customizes ListViews/DetailViews and sends me the Model.User.xafml to merge in the changes into our different modules xafmls. Of course it is also possible to merge changes with a texteditor, but this is really an annoying job. Therefore I really would like to use the 'Merge User Model...' action again.

You can try the ModelDifference module for now until I update u it can merge differences at runtime in seperate layers and then u can manually copy them to your model.user.xafml

@apobekiaris
Copy link
Member

I guess you are right: The static constructor should be called always. Probably I attached the Debugger to late. Nevertheless the various static Assembly fields (_xafWinAssembly, ...) are null and therefore the error is thrown.

actually the real problem is that VS maybe not able to handle so many resources introduced from the mapping, anyway I am starting a trial on the MMM and I will update u asap

@apobekiaris
Copy link
Member

if i remember well u r not in GAC right?

@krombipils
Copy link
Author

You can try the ModelDifference module for now until I update u it can merge differences at runtime in seperate layers and then u can manually copy them to your model.user.xafml

Sounds like a sensible workaround

if i remember well u r not in GAC right?

Latest DevExpress version is installed in the GAC on my development machine, eXpand is not installed. On our build server DevExpress is not installed in the GAC, but this shouldn't matter.

@apobekiaris
Copy link
Member

we might need to set an eviroment variable to help vs locate the assemblies if not in gac and not in path

@krombipils
Copy link
Author

But this is not the problem on my side. The DX assemblies are in the GAC. Or are you talking about Xpand assemblies?

@apobekiaris
Copy link
Member

sorry I am used to adding thoughts/notes on the ticket itself not to lose them

@expand
Copy link
Member

expand commented Aug 7, 2019

The DevExpress.XAF repository includes commits that relate to this task:

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 the Xpand.XAF.Modules 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.

@expand expand added this to the 19.1.502.0 milestone Aug 7, 2019
@krombipils
Copy link
Author

Thank you!

Unfortunately there still seems to be a bug: If I open Model.xafml from my agnostic module, everything is fine. But if I try to open Model.xafml from my winforms module, the Multiple ModelMapper assemblies in the domain check your Model.DesignedDiffs.log if you are at design time error is thrown.
According to the log, ModelMapper is loaded from the source folder and also from a AppData\Local\Microsoft\VisualStudio folder

...
Xpand.XAF.Modules.CloneMemberValue, Version=1.2.42.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\wbx2kfnx01\Xpand.XAF.Modules.CloneMemberValue.dll
Xpand.XAF.Modules.CloneModelView, Version=0.0.26.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\tu1dljya01\Xpand.XAF.Modules.CloneModelView.dll
Xpand.XAF.Modules.HideToolBar, Version=0.0.18.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\sbeqhewk01\Xpand.XAF.Modules.HideToolBar.dll
Xpand.XAF.Modules.ModelMapper, Version=1.1.34.2, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\kzbv0qnz01\Xpand.XAF.Modules.ModelMapper.dll
Xpand.XAF.Modules.ModelMapper, Version=1.1.34.2, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\source\repos\ProjectCompliance\WinForms.Module.Win\bin\Debug\Xpand.XAF.Modules.ModelMapper.dll
Xpand.XAF.Modules.ModelViewInheritance, Version=1.1.34.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\lb86-edb01\Xpand.XAF.Modules.ModelViewInheritance.dll
Xpand.XAF.Modules.ProgressBarViewItem, Version=0.0.12.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\skdpdmwj01\Xpand.XAF.Modules.ProgressBarViewItem.dll
Xpand.XAF.Modules.Reactive, Version=1.2.42.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\p4tyb1bo01\Xpand.XAF.Modules.Reactive.dll
Xpand.XAF.Modules.Reactive, Version=1.2.42.0, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\source\repos\ProjectCompliance\WinForms.Module.Win\bin\Debug\Xpand.XAF.Modules.Reactive.dll
...

@apobekiaris
Copy link
Member

i tested against XVideoRental however there are changes in the eXpand modules yet to be published. u will get notified again

@expand
Copy link
Member

expand commented Aug 7, 2019

eXpand.lab release 19.1.502.2 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

@apobekiaris
Copy link
Member

the above release at least in my tests in XVIdeoRental works fine

@apobekiaris apobekiaris removed their assignment Aug 7, 2019
@krombipils
Copy link
Author

Latest version is still not working on my side, but I guess I found the issue: I have JetBrains ReSharper installed on my machine and it has some dependencies on very old DevExpress libs.
The Init() method seems to pick up one of these old assemblies and tries to extract the versionSuffix, but the regex does not match for e.g. DevExpress.Data.v7.1.dll
ModelEditor

@apobekiaris apobekiaris self-assigned this Aug 8, 2019
@expand
Copy link
Member

expand commented Aug 8, 2019

The DevExpress.XAF repository includes commits that relate to this task:

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 the Xpand.XAF.Modules 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.

@apobekiaris apobekiaris removed their assignment Aug 8, 2019
@apobekiaris apobekiaris removed this from the 19.1.502.0 milestone Aug 8, 2019
@krombipils
Copy link
Author

I'm still getting the Multiple ModelMapper assemblies in the domain error after I upgraded to 1.1.35.1. I deleted the ~\AppData...\ProjectAssemblies folder, but VS recreates it as soon as I try to open the Model.xafml.
I don't know why this does not happen on your side, but are multiple ModelMapper assemblies really a problem? Both assemblies have the same version, therefore this should be fine?!

@krombipils
Copy link
Author

According to stack overflow, VS designers copy dlls to the ProjectAssemblies folder by default. Therefore it should be save to ignore duplicates in this folder

@apobekiaris
Copy link
Member

I don't know why this does not happen on your side, but are multiple ModelMapper assemblies really a problem?

yes there is a different initialization for the double thats why I added that constrain.

I don't know why this does not happen on your side

unfortunately i cannot repro it on my side what the locations of ModelMapper? check the log

@apobekiaris
Copy link
Member

yes there is a different initialization for the double

2 types are different if they come for different assembly even if versions, token match

@krombipils
Copy link
Author

unfortunately i cannot repro it on my side what the locations of ModelMapper? check the log

I already posted the log for the old version. Locations are the same for the new version

Xpand.XAF.Modules.ModelMapper, Version=1.1.34.2, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\AppData\Local\Microsoft\VisualStudio\16.0_f1cafe15\ProjectAssemblies\kzbv0qnz01\Xpand.XAF.Modules.ModelMapper.dll
Xpand.XAF.Modules.ModelMapper, Version=1.1.34.2, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958, Location=C:\Users\andre\source\repos\ProjectCompliance\WinForms.Module.Win\bin\Debug\Xpand.XAF.Modules.ModelMapper.dll

The winforms designer cache is a standard feature of VS, but I think it is not documented very well (and it is the cause of some annoying bugs...)
I now installed ModelMapper.dll to the GAC and this fixes this problem (only the dll from the GAC is loaded). Of course this is not a real solution, but maybe you cannot repro my problem, because you are also using the GAC?

Unfortunately I still cannot use the ModelEditor, because I'm now back to the unable to load "System.Interactive, Version=3.2.0.0" at Xpand.XAF.Modules.ModelMapper.Services.ModelExtendingService.AddExtenders(ModelInterfaceExtenders extenders) issue.
System.Interactive is actually not loaded in Visual Studio.

@apobekiaris
Copy link
Member

did u close this by mistake?

No I do not use the GAC,

#494 not yet published contain related fixes, subscribe there to get notifiex, also please update your modelmapper to the latest or wait for update the eXpandFramework all together I will integrate it soon.

@krombipils krombipils reopened this Aug 9, 2019
@krombipils
Copy link
Author

did u close this by mistake?
Jap, re-opened it.

No I do not use the GAC,
Okay, then I have no idea where's the difference.
Looking forward to your latest changes

@expand
Copy link
Member

expand commented Aug 9, 2019

eXpand.lab release 19.1.502.7 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

@expand expand added this to the 19.1.503.0 milestone Aug 9, 2019
@expand
Copy link
Member

expand commented Aug 9, 2019

eXpand.lab release 19.1.502.8 includes commit that relate to this task:

Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

@expand expand removed this from the 19.1.503.0 milestone Aug 10, 2019
@expand expand added the Reactive.XAF eXpandFrameowrk/DevExpress.XAF project label Aug 10, 2019
@krombipils
Copy link
Author

Thank you!!!
I don't know how you did it, but the VS ModelEditor is finally working again!

btw: According to the debugger, only the ModelMapper.dll from the ProjectAssemblies path is loaded...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug ModelMapper Reactive.XAF eXpandFrameowrk/DevExpress.XAF project
Projects
None yet
Development

No branches or pull requests

3 participants