Skip to content

Commit

Permalink
fix #3589 Inspecting WebAPI REST Endpoints UI sometimes fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tvatavuk committed Feb 28, 2025
1 parent eb95fff commit 7720e70
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Web.Hosting;
using ToSic.Eav.Apps.Internal;
using ToSic.Eav.Context;
using ToSic.Eav.Plumbing;
using ToSic.Eav.WebApi.ApiExplorer;
using ToSic.Lib.Logging;
using ToSic.Sxc.Code.Internal.HotBuild;
Expand Down Expand Up @@ -50,7 +51,7 @@ private Assembly GetCompiledAssembly(string path)
var appJson = SysHlp.GetService<IAppJsonService>();
var block = SysHlp.GetService<DnnGetBlock>().GetCmsBlock(Request);
var codeFileInfo = SysHlp.GetService<SourceAnalyzer>().TypeOfVirtualPath(controllerVirtualPath);
if ((block != null && appJson.DnnCompilerAlwaysUseRoslyn(block.AppId)) || codeFileInfo.AppCode)
if ((block != null && appJson.DnnCompilerAlwaysUseRoslyn(block.AppId)) || codeFileInfo.AppCode || FileInAppCode(path))
{
Log.A("has AppCode");
// Figure edition
Expand All @@ -77,4 +78,6 @@ private Assembly GetCompiledAssembly(string path)
[JsonFormatter(Casing = Casing.Camel)]
public AllApiFilesDto AppApiFiles(int appId) => Real.AppApiFiles(appId);

private bool FileInAppCode(string path) => path.StartsWith("AppCode\\api\\", StringComparison.InvariantCultureIgnoreCase) || path.ContainsInsensitive("\\AppCode\\api\\");

}

0 comments on commit 7720e70

Please sign in to comment.