Reputation: 21
I have migrate my code from .net framework to.net core 8, and I have an issue with Assembly.LoadFrom(mydll.dll) which work fine with .net framwork, but is not working with .net core 8.0. The assembly that I am trying to load has no dependency and is in the root directory of the application.
The following is the code I use in .net core.
private void myButton_Click(object sender, RoutedEventArgs e)
{
myButton.Content = "Clicked";
var path = @"D:\Code\Trial\App1\App1\bin\x86\Debug\net8.0-windows10.0.18362.0\DT0WDX13";
Assembly.LoadFrom(path);
}
And the following I use in .net framwork
private void Button_Click(object sender, RoutedEventArgs e)
{
myButton.Content = "Clicked";
var path = @"D:\Code\Trial\WpfApp1\WpfApp1\bin\Debug\DT0WDX13";
Assembly.LoadFrom(path);
}
Upvotes: 0
Views: 29
Reputation: 21
I have figure it out, and it seems that there was something else in the code that was rejecting the load of the assembly, I wish the error was better explained.
Upvotes: 0