Open kasperk81 opened 1 year ago
Moving to aspnetcore. In general it feels like these are two incompatible asks: to be ahead of time compiled, but also to do runtime compilation. Agree that the single file story could be improved though.
In general it feels like these are two incompatible asks: to be ahead of time compiled, but also to do runtime compilation.
they are not. aot supports subset of reflection apis. if compilation code is restricted to just use those apis (and other apis on the "aot supported" surface) then it will be compatible with nativeaot. reading assemblies from memory map (bundle) is a plus for both singlfile and nativeaot.
i had the same problem. did you solve it?
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
i use.net 8, The problem still exists.
@dotnet-policy-service this isn't a pr, this is an issue..
In the .net 8, The problem still exists. When using the Microsoft AspNetCore MVC Razor The RuntimeCompilation component to publish the asp.net core razor page project as a single file project and calling the dynamic compilation time AddRazorRuntimeCompilation, the same error occurs
Detailed problem description in this place https://github.com/dotnet/aspnetcore/issues/54315
runtime compilation in .net 6 app published as a single file (
<PublishSingleFile>true</PublishSingleFile>
) works only with extraction to filesystem (<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
).without extraction, it throws:
https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#api-incompatibility
if file-on-disk requirement is the only thing limiting user to access razor runtime compilation in
PublishSingleFile
apps, please consider adding support of in-memory assemblies without going through file i/o.aside: in .net 7, this problem becomes real with
<PublishAot>true</PublishAot>
. there is no workaround asIncludeAllContentForSelfExtract
because nativeaot does not use apphost.