-
Notifications
You must be signed in to change notification settings - Fork 16
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
Core migration #3186
base: main
Are you sure you want to change the base?
Core migration #3186
Conversation
…rge post-build event.
…ontain some UI components.
Matlab and Scilab are still disable because connectors are not tested on dotnet core.
Further Todos as discussed:
|
I would tend to say yes. The main reason for the starter is to be able to check plugin descriptions and dependencies before loading the Optimizer. Another reason was to provide the possibility of multiple apps. However, I would say we can just provide them as separate executable instead of via the common starter.
Ok, can later be re-added as a plugin (outside of HL main repo). |
Removed all .snk files Removed corresponding csproj elements Removed leftover pre-/post build events
I'm also not quite sure about this, but I think in general (and in all other places in HL its like this) an exception is thrown in the non-gui code and the gui catches the error and displays the dialog. So I would also go with exceptions. But, if we really need an alternative, we could also do something like the following in PluginInfrastructure: public static void ShowError(string message, Exception exception) {
Type guiErrorHandling = Type.GetType("HeuristicLab.PluginInfrastructure.Views.ErrorHandling");
if (guiErrorHandling == null) {
throw exception;
} else {
guiErrorHandling.GetMethod("ShowErrorDialog", [typeof(string), typeof(Exception)]).Invoke(null, [message, exception]);
}
} |
Please note that cbd3aec breaks reading/writing HL files (and therefore also the StartPage) until heal-research/HEAL.Attic#53 is done |
We have encountered a performance issue in certain cases when using .NET 8, which is resolved by upgrading to .NET 9. The issue arises due to a bug (?) in the .NET 8 runtime related to reflection on system types with self-referencing generic constraints. Details:When loading a Problem that implements For non-generic types, this process is straightforward. However, for generic types, we rely on Rather than calling In .NET 8, several generic interfaces with self-referencing generic argument constraints were introduced, such as public interface Due to the missing self-referencing constraint, HeuristicLab fails to filter out incompatible types before attempting to build a generic type, leading to exceptions. Since .NET 8 introduced many types with self-referencing generic constraints, this results in a significant increase in exceptions. I could not find any issues, pull requests, or Stack Overflow discussions addressing this behavior, but it appears to be resolved in .NET 9. Therefore, for HeuristicLab, we should either upgrade to .NET 9 as soon as possible or live with the performance regression for such cases. using System;
using System.Linq;
var tselfCustomType = typeof(ISelfReferencing<>).GetGenericArguments()[0];
var tselfSystemType = typeof(IUtf8SpanParsable<>).GetGenericArguments()[0];
Console.WriteLine(tselfCustomType.GetGenericParameterConstraints().Count()); // 1
Console.WriteLine(tselfSystemType.GetGenericParameterConstraints().Count()); // 0
public interface ISelfReferencing<TSelf> where TSelf : ISelfReferencing<TSelf>? { } |
…`TypeExtensions.BuildType`.
…d only references required plugins for starting the optimizer.
…emoved all outdated project references from the solution file.
It seems that the discussed issues that cause some exceptions for the PluginInfrastucture TypeExtensions (see #3186 (comment)), stems from a runtime bug, not so much a .net 8/9 bug. When using explicit runtime versions for a self-contained deployment (to be independent from the installed runtimes), it seems that the bug is present in version 8.0.8 and resolved in the runtime version 8.0.10. This can be reproduced by the following code: var tselfCustomType = typeof(ISelfReferencing<>).GetGenericArguments()[0];
var tselfSystemType = typeof(IUtf8SpanParsable<>).GetGenericArguments()[0];
Console.WriteLine(Environment.Version);
Console.WriteLine(tselfCustomType.GetGenericParameterConstraints().Count());
Console.WriteLine(tselfSystemType.GetGenericParameterConstraints().Count());
public interface ISelfReferencing<TSelf> where TSelf : ISelfReferencing<TSelf>? { } global.json {
"sdk": {
"version": "8.0.304", // or 8.0.403
"rollForward": "disable"
}
} When publishing using two different global.json files to configure the runtime, we get to different outputs dotnet publish '.\HeuristicLab\3.3\HeuristicLab-3.3.csproj' --outputo bin --self-contained --framework net8.0-windows`
|
…g .net9.0 preview and instead specifies a minimum SDK version of 8.0.403 to avoid a reflection issue with the runtime.
dotnet publish
Known issues:
ToDos: