2sxc: Oqtane - Error compiling AppCode.dll
I’m submitting a
[x] bug report
…about
[x] other / unknown
Current Behavior / Expected Behavior
Importing apps from DNN to test in Oqtane. Some work with no issues, other report this:
Error: System.Exception: Error: Can't compile 'AppCode.dll' in AppCode. Details are logged into insights. Bad IL format. The format of the file ' .... \App_Data\2sxc.bin\App-00006-AppCode-5c98a772de834cf2f6cbaba95a058d43347c40224e3ac673b0d60a04183c20b8.dll' is invalid. at ToSic.Sxc.Razor.RazorCompiler.FindViewAsync(ActionContext actionContext, String partialName, IApp app, HotBuildSpec spec) at ToSic.Sxc.Razor.RazorCompiler.CompileView(String partialName, Action1 configure, IApp app, HotBuildSpec spec) at ToSic.Sxc.Razor.RazorRenderer.RenderToStringAsync[TModel](String templatePath, TModel model, Action1 configure, IApp app, HotBuildSpec hotBuildSpec) at ToSic.Sxc.Razor.RazorEngine.RenderTask(RenderSpecs specs)
This is the content of the folder:
Instructions to Reproduce the Problem
Load any view (from specific apps with no significant differences).
Your environment
- 2sxc version(s): 18.02.00
- Oqtane: 5.2.4
- Hosting platform: IIS
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (10 by maintainers)
Commits related to this issue
- fix https://github.com/2sic/2sxc/issues/3505 Error compiling AppCode.dll in Oqtane — committed to 2sic/2sxc by tvatavuk 2 years ago
- fix https://github.com/2sic/2sxc/issues/3505 — committed to 2sic/2sxc by tvatavuk 2 years ago
- fix https://github.com/2sic/2sxc/issues/3505 — committed to 2sic/2sxc by tvatavuk 2 years ago
Ok.
I tried three things:
There are two important issues I tested: the file upload failures in Oqtane and the AppCode compile failure. On 1 (same files, different server) and 3 (new 6.0 install on same server with new IIS config ) the file upload issues are gone and the AppCode issue is gone (mostly). On 2 (same files, new IIS config) the issues persist.
So this have to be caused by a combination of IIS config and files / oqtane config. Either way I’m not going to pursuit this any more. Just going forward with the new 6.0 install.
BUT, I can still replicate the AppCode compile error with this condition: Any code error in the AppCode/helper.cs causes an initial display of the error, and then the “Can’t compile ‘AppCode.dll’ in AppCode” after a reload. I migrate the test apps from DNN, so there are a lot of issues with framework => .net core (like the HttpCookie class and all cookie related fetch functions).
So this HAS TO be replicate the issue on your end:
To trigger the issue change
return "Hello" + a;toreturn "Hello" + ab;or any other code errorThe first load gets this: Error: System.Exception: CS0103: The name ‘ab’ does not exist in the current context at ToSic.Sxc.Razor.RazorCompiler.FindViewAsync(ActionContext actionContext, String partialName, IApp app, HotBuildSpec spec) at ToSic.Sxc.Razor.RazorCompiler.CompileView(String partialName, Action
1 configure, IApp app, HotBuildSpec spec) at ToSic.Sxc.Razor.RazorRenderer.RenderToStringAsync[TModel](String templatePath, TModel model, Action1 configure, IApp app, HotBuildSpec hotBuildSpec) at ToSic.Sxc.Razor.RazorEngine.RenderTask(RenderSpecs specs)And after a reload: Error: System.Exception: Error: Can’t compile ‘AppCode.dll’ in AppCode. Details are logged into insights. Image is too small. at ToSic.Sxc.Razor.RazorCompiler.FindViewAsync(ActionContext actionContext, String partialName, IApp app, HotBuildSpec spec) at ToSic.Sxc.Razor.RazorCompiler.CompileView(String partialName, Action
1 configure, IApp app, HotBuildSpec spec) at ToSic.Sxc.Razor.RazorRenderer.RenderToStringAsync[TModel](String templatePath, TModel model, Action1 configure, IApp app, HotBuildSpec hotBuildSpec) at ToSic.Sxc.Razor.RazorEngine.RenderTask(RenderSpecs specs)The only thing that changed with the new server or new install in new IIS config is that the error now only triggers if there are codding errors on the helper (before is happened even with no helpers in the folder).
If you still cannot replicate this, please give me an e-mail address to send you the login info to a test install on my server.
I have had the same problem with oqtane 6.0 for .NET 9.0 Cheers
I believe @tvatavuk will look into this this week.