building ASP.Net core shared framework dlls to output directory

91 Views Asked by At

I am building a .Net 6.0 library which is being loaded by another application located within an appliance. I have no control over the appliance or the loader app. This library requires references to the Microsoft.AspNetCore.App shared framework. As this evidentially has not been added to the loader application, I get could not load assembly errors for any packages from within the shared framework. Is there any way to force VS2022 to add the required dlls from the framework to the output folder on compile?

<PreserveCompilationContext>true</PreserveCompilationContext> adds the reference dlls to the refs folder but not the runtime dlls required.

1

There are 1 best solutions below

1
On

In the properties of the package in the library in VS, try to set Include Assets all .

enter image description here

Then rebuild and test.

result:

enter image description here