AaronRobinsonMSFT / DNNE

Prototype native exports for a .NET Assembly.
MIT License
394 stars 41 forks source link

Can the file be separated #166

Closed BoneTM closed 1 year ago

BoneTM commented 1 year ago

Don't want to put native code and dotnetcore in the same directory, can i move the dotnetcore to any other folder?

AaronRobinsonMSFT commented 1 year ago

Don't want to put native code and dotnetcore in the same directory,

Which file? The resulting native binary with exports or the generated .c file? At present there is no way to separate the two as they are technically bound to one another with the generated .runtimeconfig.json file. Can you share some more details on why this is needed or the possible confusion it is creating?

BoneTM commented 1 year ago

thanks for answering.

1st, there is a dotnet core project with dnne name Program.dll, after publish, there will be a ProgramNE.dll file. 2nd, i make a c++ project name wtf.dll which will link ProgramNE.dll

is it possible to make the folder structure like:

folder extensions with file wtf.dll folder nethost with ProgramNE.dll and Program.dll after all there is a app.exe will load wtf.dll under the extensions folder, then let the wtf.dll load other folder like nethost's ProgramNE.dll

can wtf.dll load from other folder like nethost?

seems like dlopen can handle that, but i need to create many stuff to get_export and redeclare the func type, can i just link it into the wtf.dll

AaronRobinsonMSFT commented 1 year ago

@BoneTM That is far more about MSBuild, .NET layout and OS loader than DNNE specifically.

can wtf.dll load from other folder like nethost?

Yes, that is possible, but you will need to update your path and ensure the loader can find the binary.

but i need to create many stuff to get_export and redeclare the func type, can i just link it into the wtf.dll

Not at present. DNNE doesn't provide a static build option.