Hello,
I have a fresh Windows 11 / Visual Studio / Devexpress 21.2.4 installation and would like to try out XAF. I created a new XAF solution with EF Core and Windows Forms. When trying to open den ModelEditor, I get the error, that I have to install .NET. I clicked on the link and installed .NET 5.0 runtime (5.0.13 - Desktop Apps and Console). After the restart of Visual Studio 2022 and opening the solution, the message to install .NET will be displayed once again. Whats missing?
Best regards
Mike
Hello Mike,
It seems that this behavior occurs for the reasons described here: Published .Net Core App Warns to Install .Net Core but it's Already Installed
The DevExpress.ExpressApp.Design.ModelEditorServer.NetCore.v21.2.exe is located at the %PROGRAMFILES(x86)%\DevExpress 21.2\Components\Tools\eXpressAppFrameworkNetCore\Model Editor path and uses net5.0 TargetFramework.
I look forward to your reply.
Thanks,
Stanley
Hello Stanley,
I tried to open the DevExpress.ExpressApp.Design.ModelEditorServer.NetCore.v21.2.exe from the folder, I receive the same message (have to install .NET). I installed now the x86 as well as the x64 version. Same resoult
The runtimeconfig.json file exists in the folder.
No clue why a fresh installation is not working…
Hello Michael,
We asked you to launch the DevExpress.ExpressApp.Design.ModelEditorServer.NetCore.v21.2.exe directly to make sure that the issue is not related to our Visual Studio extension.
I suggest you do the following:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net5.0-windows</TargetFramework> <UseWindowsForms>true</UseWindowsForms>
Target platform: Any CPU.
Build it and try to launch the generated exe file form the bin folder.
4) If it also throws an exception, the problem is in the installed Runtime version and does not relate to DevExpress.
5) If it launches without exceptions, please send us this project with the bin folder and the %PROGRAMFILES(x86)%\DevExpress 21.2\Components\Tools\eXpressAppFrameworkNetCore\Model Editor folder. We will try to find the difference.
Hello Alex,
I installed the .NET 5 SKD and runtime. After restart of the computer, I still have the same problem. Also opening %PROGRAMFILES(x86)%\DevExpress 21.2\Components\Tools\eXpressAppFrameworkNetCore\Model Editor direktly from the folder shows the message to install .NET.
The problem also occurs when opening the SimpleProjektManager Example of the demos…
Is there maybe a workload or component missing of visual studio 2022 that has to be installed?
When I create a complete new XAF solution (C#), start the XAF Solution Wizard (.NET Core), select Windows Forms, EF Core, no Authentication and then try to open the Model Editor, always the message to install .NET will be displayed. So I think its not the project itself …
Hi Michael,
Please allow us some time to discuss how to proceed with resolving the issue.
i also had this problem once - if installing manually take care that the model editor needs
Microsoft.WindowsDesktop.App
andMicrosoft.AspNetCore.App
- so i think you need to install also ASP.NET Core Runtime 6.0.1.Now I installed also the Asp.net Core Bundle (5 and 6), the error still appears and Model Editor will not be opened.
How about this :
Edit the file :
C:\Program Files (x86)\DevExpress 21.2\Components\Tools\eXpressAppFrameworkNetCore\Model Editor\DevExpress.ExpressApp.Design.ModelEditorServer.NetCore.v21.2.runtimeconfig.json
To be like this
{ "runtimeOptions": { "tfm": "net6.0", "frameworks": [ { "name": "Microsoft.WindowsDesktop.App", "version": "6.0.0" }, { "name": "Microsoft.AspNetCore.App", "version": "6.0.0" } ], "configProperties": { "System.Reflection.Metadata.MetadataUpdater.IsSupported": false } } }
Hello Michael,
Let's forget about the Model Editor and XAF projects for now. You said that "the problem also occurs when opening the SimpleProjektManager Example of the demos…". It looks like the exception is thrown for all exe files built with .NET 5.0 and the problem is in the environment. That's why I asked you to check point 3: Try to create a new WinForms project with the described settings and launch its exe file.
Please do this and share your results with us.
Hello Mahfoud,
editing the config-file works for me. I have installed .NET 6 runtime, sdk and asp.net core and now I can use the model editor.
Thank you very much.
Hello Michael;
I'm glad I can help
Thank you Mahfoud.
Your solution solved my problems too.
Best regards,
Ægir