我尝试在我的ASP.NET核心总部基地项目中使用如下区域:
我尝试添加一个文件包,如下所示:
<abp-script src="/Areas/Community/Pages/Mentors/Index.js" />
当我尝试运行页面时,我得到以下错误:
AbpException: Could not find the bundle file '/Areas/Community/Pages/Mentors/Index.js' from IWebContentFileProvider
文档说这些文件可以位于页面、视图、组件和主题中,但如果不支持区域,它似乎是有限的。我是否需要在某个地方添加路由,这样虚拟文件系统才能找到它?
更新:我在\Volo.Abp.AspNetCore\Volo\Abp\AspNetCore\VirtualFileSystem\AbpAspNetCoreContentOptions.cs中找到了源代码
它设置AllowedExtraWebContentFolders列表的位置:
AllowedExtraWebContentFolders = new List<string>
{
"/Pages",
"/Views",
"/Themes",
"/Components"
};有什么方法可以添加到这个列表中吗?
发布于 2021-03-12 15:35:57
您可以在模块的ConfigureServices方法中配置它。
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpAspNetCoreContentOptions>(options =>
{
options.AllowedExtraWebContentFolders.Add("/Areas");
});
}https://stackoverflow.com/questions/66558082
复制相似问题