FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

Exception in Config.cs,LoadPluginsInCurrentFolder:527

Open sf8321 opened this issue 3 years ago • 1 comments

hallo,

my problem is that i have and exception in Config.cs,LoadPluginsInCurrentFolder:527 because ApplicationFolder is empty because AppDomain.CurrentDomain.BaseDirectory is empty. i my pull request i have solved this with a new property that i can set before new Report(). a new property because i do not what to change the original behavior. if no use the new property nothing is changed.

..... private static void LoadPluginsInCurrentFolder() { // find all plugin-connector in current directory var plugins = Directory.GetFiles(ApplicationFolder, "FastReport.Data.*.dll");

the other change is the assembly loading. i am in the situation

cpp program dotnet 6.0 hosted dotnet core plugin system started with 3.1 (use google github mc master plugin dotnetcore) hotreload reflectionContext (because i use reflection a lot inside the plugins)

in my copy of the code i removed all old targets and use only net6.0

i do not know if the FastReport Plugins can successfully loaded in this situation

    private static void LoadPluginsInCurrentFolder()
    {
        const string searchPattern = "FastReport.Data.*.dll";

..... ProcessAssembly(Assembly.LoadFrom(pluginName));

sf8321 avatar Feb 16 '22 15:02 sf8321

hallo, in the FastReport.Compat i can create a new File/Class for the methods and use it in FastReport

LoadFromStream, LoadFromFile, LoadFromAssemblyName in dotnet core it is implemented like ... if (AssemblyLoadContext.CurrentContextualReflectionContext != null) { assembly = AssemblyLoadContext.CurrentContextualReflectionContext.LoadFromStream(asm); } else { assembly = AssemblyLoadContext.Default.LoadFromStream(asm); } ... in all other versions ... Assembly.Load(name); // or eqauls for stream, file, name, ... ....

sf8321 avatar Feb 16 '22 16:02 sf8321

Hello, are you still experiencing this issue?

Alekarfes avatar Jan 31 '24 10:01 Alekarfes

Hello, i use FastReport.Utils.Config.ApplicationFolder = .....; before

Report report = new Report();

and all works as expected.

Am Mi., 31. Jan. 2024 um 11:16 Uhr schrieb Alekarfes < @.***>:

Hello, are you still experiencing this issue?

— Reply to this email directly, view it on GitHub https://github.com/FastReports/FastReport/issues/405#issuecomment-1918801214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQG57GX2CA3VDO4LEB776BDYRIKZHAVCNFSM5OR7Q4E2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRHA4DAMJSGE2A . You are receiving this because you authored the thread.Message ID: @.***>

sf8321 avatar Jan 31 '24 14:01 sf8321