nulastudio / NetBeauty2

Move a .NET Framework/.NET Core app runtime components and dependencies into a sub-directory and make it beauty.
MIT License
419 stars 21 forks source link

使用 Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 发布Publish会运行出错 #65

Closed Fat-Snail closed 5 months ago

liesauer commented 5 months ago

能提供一个可复现的demo吗

Fat-Snail commented 5 months ago

https://stackoverflow.com/questions/78221150/runtime-compilation-of-razor-pages-does-not-work-net-8-vs2022

就是参照这个案例,然后再引用NetBeauty就不行了

liesauer commented 5 months ago

最好能提供一个demo复刻,不然很多都是会有不一样的效果

Fat-Snail commented 5 months ago

https://github.com/Fat-Snail/X-Net-Mod/blob/main/RazorDom.zip 最近在忙其他事情,这包含两个项目,一个是mvc、一个是web page 引用了NetBeauty 后 发布会报

System.ArgumentOutOfRangeException: length ('-1') must be a non-negative value. (Parameter 'length') Actual value was -1.

liesauer commented 5 months ago

目前已经确认是和Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation包冲突的问题,这个包会解析deps.json,要求里面包的格式必须是xxxxxx/1.0.0.0,但是startup hook这个特定dll是要xxxxx的格式的,不带版本号,加了版本号hook就加载不了