Is it possible to publish multiple self contained .Net Core apps with one shared framework

753 views Asked by At

I have a solution with two .Net Core console applications. I want to publish both as a self contained application. Both applications use the same framework. My question is, how can I publish them so that I have only one framework, which both applications are using?

The problem is, that each application would need about 95 MB space if published separately. That is why I want to publish them together, so that they only need one time the space for the framework. Is that possible?

2

There are 2 answers

1
Igor Goyda On

There is a sort of workaround: you can create an empty project with references on your two applications and publish the newly created project.

1
Lorenzo Isidori On

Your constraints make your goal not possible. If the applications should be self contained, they must have their own framework dlls.

95MB is a very small size, and even if you find a way to share framework, I suggest you to do not that. Because in that way you tie up the two applications making their updates eventually not possible.