Need I enable ReadyToRun in each of my dll whlie publish the exe file?

Viewed 761

As we know, there is ReadyToRun compilation option since .net core 3.0 .

There is several dll that made by .net core .

I created a WPF project and referenced all the dll above.

Now I am about to publish the project with ReadyToRun and there is a problem I am not so sure.

Whether the compiler will compile all the reference dll with ReadyToRun while I just compile the WPF project?

Or I have to compile with the ReadyToRun one by one in its project?

Why I asked the question it is so troublesome to compile so many dll with the different target times. I want to find a fast way to do it.

Thank you .

1 Answers

It should be enough to add the <PublishReadyToRun> setting to the project that you are publishing. You may also use the -p:PublishReadyToRun=true command-line option:

dotnet publish ... -p:PublishReadyToRun=true

You can exclude certain assemblies from being compiled into ReadyToRun images using the PublishReadyToRunExclude item group:

<ItemGroup>
    <PublishReadyToRunExclude Include="FilenameOfAssemblyToExclude.dll" />
</ItemGroup>
Related