-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support loading ASP.NET Core into non-default load contexts #21159
Comments
The good news is, using Assembly.Load is good using Assembly.LoadFrom/LoadFile isn't so good. We only have one place that does this in the product today so we're in pretty good shape so far. |
Depending on what the overall feature should be Currently runtime doesn't support loading frameworks into isolated ALCs, so the typical use case is actually loading ASP.NET itself into default ALC (since it's a framework) and loading the app into a secondary ALC. This has been asked for several times, recently for example here: dotnet/runtime#37584. Scenarios I know of are for example:
In such case even It might be possible to workaround this by using Also note that similar issues to Ability to load ASP.NET itself into a secondary ALC is more complex. Not only it would likely require testing and other work on the ASP.NET side, but it's actually a rather non-trivial runtime feature. It's also unclear if this is the actual intent (Do we expect customers to run different versions of the ASP.NET framework inside one process?). Yet another issue is unloadability - to correctly support the ability to reload an app without restarting the process not only the app has to run in a secondary ALC, but such ALC must be able to unload. Currently there are several issues in the core framework ( |
Thanks for contacting us. |
Sounds like this issue will need investigation. Potentially for the next release. |
@Pilchie looks like we might need someone to investigate what we want to do here, potentially for 6.0. Is there a higher level initiative to modules support across dotnet? |
We have a bunch of these issues around what happens when you try to use various parts of ASP.NET Core with AssemblyLoadContext. The goal is to spend some time understanding those scenarios so that we can make a better judgement call as to whether we want to do something about them. Here's another example of an issue that came up with ALC in MVC #21744 |
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. |
* Add cpu module * Fix build * Pass unary * Use custom pe loader * Remove unused code * Skip some tests cpu codegen doesn't support * Add linux support * Fix win * Fix * Fix macos * Add pack * Add macho loader * Fix unary test * fix call function * Add -fno-stack-protector * Fix find vs * Add sinh cosh * Add linear_size() * Fix macos * Add square * Add sign * Add ntt(nncase tensor template) * Fix macos * Fix macos * Add rsqrt * Import memcpy for gcc * Disable lto * Compile-time apply * Add binary * Setup ninja * Fix build * Fix build * Fix slicing codegen * Fix findvc * Fix build * Disable macos cpu module * Add pow * Link __chkstk on win32 * Avoid stackoverflow * Optimize unary apply * Fix build * Update unary impl * Fix build * Add l2 fuse * fix test * Add missing parts * Update * Add AllocateBufferView * Pass test simple unary * add rewriter * fix codegen * fix elf loader * fix mac build * fix ci * fix ci * Move AffineMap * Fix ut * fix mac build * Add Affine.Grid * Start to code auto tiling * refactor code * pass packed layernorm * add binary * add binary test * Try matmul tiling * More generic cost * Tiling: parameterize * pass unittests * format * reverse cpu target * add packed kernel * add unary simd support * Add grid auto tile * fix ci * fix mac build * fix linux build * fix packed matmul evaluator * disable cnblogs source * Chain the pipeline * Add allocate buffer scope * fix dotnet build * add packing * refactor vector type * fix vector type * fix cmake path * add x86 pack unpack kernel * Move auto tile to schedule proj * Fix win build * fix repeated AutoPacking * fix mac build * Add buffer subview * Fix cmakelist template * Fix win32 runtime build * fix mac test * add layer norm * skip the failed case * add layer norm case * fix layernorm test * pass packed layer norm * fix mac build * fix packed transpose vi * add arm neon packed softmax * add packed softmax * fix mac ci * add blame * add 1d packed matmul * disable pack test * add packed matmul * fix mac * add packed matmul * add more kernel * refactor cpu kernels test * fix some bug * add copy * fix ci * fix mac build * fix mac build * add gather * Add ranked_shape support for pack and some test cases. * compile decode layer success * Add ranked_shape support for unpack and some test cases. * fix bug * Support softmax axis != packed axis for packed_softmax. * add buffer schedule * fix mac loader * pass mac loader * opt copy and matmul * pass 65b decode layer * fix ci * Fix layer norm axis > pack axis and support broadcasting for scale/bias. * add pad/fix bugs * fix packed layer norm * fix arm vector 4 reduce sum * add packed layernorm case * fix ci * Remove unused deps * Refactor ntt * Fix * fix linux ci * Fix build * Fix build on Ubuntu. * Add aarch64 types * fix mac build * Fix build * Fix load model with binary mode * Use M1 runners * Use python 3.10 * Use python 3.10 * Fix macos CI * Remove halide * Remove halide * Skip TestDecodeLayer in CI * Add ctest for ntt and fix unary bugs. * Rename ctest files to avoid confliction. * Fix msvc empty bases bug * Fix build * onnxoptimizer==0.2.7 * Update vulkan * Update torch * Update mac vulkan * Remove caffe * Update CI * Upgrade packages * Move setup python * Fix win deps * Remove omp * debug * Add floor_mod and ctest cases for ntt binary. * Add bin to python search path * Remove gsl * Fix build * Fix build * Fix win test * Disable F.InterpolationMode.BILINEAR * Disable test_conv2d_transpose * Disable test_expand_dims * Disable test_fully_connected * Disable test_conv2d_prelu * Disable test_squeeze_transpose_shape * Add x86_64 avx optimization and test cases for unary. * Disable test_mobilenetv1 * Disable test_mobilenetv2 * Disable tflite_model test * Disable ncnn test as ncnn pypi doesn't support arm64 * Disable test_pad_reduce_window2d and enable ncnn test * Disable test_reduce_window2d * Upgrade packages * Downgrade Microsoft.CodeAnalysis.CSharp to 4.7.0 * Disable DOTNET_INIT_FOR_CONFIG as aspnet doesn't support non-default ACL dotnet/aspnetcore#21159 * Fix kernel tests * All extract with null constrains * Apply code-format changes --------- Co-authored-by: 郑启航 <597323109@qq.com> Co-authored-by: zhangyang2057 <zhangyang@canaan-creative.com> Co-authored-by: sunnycase <sunnycase@users.noreply.github.com>
Describe the solution you'd like
Users creating a module system that uses ASP.NET Core will run into problems if they are using a non-default
AssemblyLoadContext
. The reason is that we have various features that operate outside of a load context, usually by usingLoadFile
instead of one of the more context-aware methods.Known features that don't support ALCs:
Additional context
While we haven't totally ignored this as an area, it's not something we document and test. At a minimum completing this would would require identifying a few scenarios that are good as samples and documenting them. We have not done a full effort to ensure that ever part of ASP.NET Core will work in this mode.
Original source: filing a feature request based on a support ticket for an unsupported scenario.
The text was updated successfully, but these errors were encountered: