Closing the issue. Feel free to re-open or create a new issue if you have further questions.
Hi,
I will try to review the sample application you sent tomorrow afternoon.
Thanks.
Hi,
Thank you for the information. I understand your problem.
If you use UseStaticFiles middleware instead of MapStaticAssets you will see that there is no problem. The problem is that the MapStaticAssets middleware does not support modifying static files after build/publishing.
You can use UseStaticFiles middleware instead of MapStaticAssets if you want to solve the problem. Or you can follow the steps below:
Create AbpStaticFileProvider:
public class AbpStaticFileProvider : IFileProvider
{
private readonly Matcher _matcher;
private readonly IFileProvider _fileProvider;
/// <param name="fileProvider">The file provider to be used to get the files.</param>
/// <param name="fileNamePatterns">The file name patterns to include when serving static files (e.g., "appsettings*.json").
/// Supports glob patterns. See <see href="https://learn.microsoft.com/en-us/dotnet/core/extensions/file-globbing">Glob patterns documentation</see>.
/// </param>
public AbpStaticFileProvider(IReadOnlyList<string> fileNamePatterns, IFileProvider fileProvider)
{
_fileProvider = fileProvider;
_matcher = new Matcher(StringComparison.OrdinalIgnoreCase);
_matcher.AddIncludePatterns(fileNamePatterns);
}
public IDirectoryContents GetDirectoryContents(string subpath)
{
return new NotFoundDirectoryContents();
}
public IFileInfo GetFileInfo(string subpath)
{
return _matcher.Match(Path.GetFileName(subpath)).HasMatches ?
_fileProvider.GetFileInfo(subpath) :
new NotFoundFileInfo(subpath);
}
public IChangeToken Watch(string filter)
{
return NullChangeToken.Singleton;
}
}
You can then invoke the UseStaticAssets middleware before the MapStaticAssets middleware as follows:
app.UseStaticFiles(new StaticFileOptions
{
~~~~FileProvider = new AbpStaticFileProvider(["appsettings*.json"], env.WebRootFileProvider)
});
Hi again,
For this, you can create the file Themes/LeptonX/Layouts/Application/_Footer.cshtml and customize its content as follows:
<div class="lpx-footbar-container">
<div class="lpx-footbar">
<div class="lpx-footbar-copyright">
<span>@DateTime.UtcNow.Year©</span>
<a href="https://leptontheme.com/" target="_blank">Lepton Theme</a>
<span>by</span>
<a href="https://volosoft.com/" target="_blank">Volosoft</a>
</div>
<div class="lpx-footbar-solo-links">
<a href="#">About</a>
<a href="#">Privacy</a>
<a href="#">Contact</a>
</div>
</div>
</div>
I am closing this question. If you have any other questions, you can open a new question.
As far as I understand, the problem does not seem to be related to ABP. I found a content like below in ASP.NET's Blazor documentation:
To prevent developer code in OnInitializedAsync from running twice when prerendering, see the Stateful reconnection after prerendering section. The content in the section focuses on Blazor Web Apps and stateful SignalR reconnection. To preserve state during the execution of initialization code while prerendering, see Prerender ASP.NET Core Razor components.
Reference: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/lifecycle?view=aspnetcore-9.0#component-initialization-oninitializedasync
You can also look here on how to prevent this.
Hi,
I can reproduce the problem according to the information you provided. I am opening an internal issue to fix this problem in the code generated by Suite.
Hello,
When you look at the pod's container, can you see that the relevant environment variable is set? ,
Also, the problem seems to be caused by CORS, but can you disable it as mentioned in this document to clear your doubts here?
You can search for context.Services.AddCors in the solution and find where it is configured.
Hello,
Sorry for the late reply, but we missed this question because the friend dealing with the subject was on vacation. However, next Monday, the friend who is interested in the subject will return to you. Thank you for your patience.