rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" />
in _Host.cshtml andhttps://localhost:5001/_content/Syncfusion.Blazor/styles/bootstrap4.csspublic void ConfigureServices(IServiceCollection services)but when I run the appliction I get a 404 error on
{
services.AddSyncfusionBlazor();
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSingleton<WeatherForecastService>();
}
Is this a problem with the documentation? Should it be done differently?
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsEnvironment("Local") || env.IsEnvironment("Production") || env.IsEnvironment("Staging"))
{
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
@"C:\Users\${user-name}\.nuget\packages\syncfusion.blazor\18.1.0.54\staticwebassets"),
RequestPath = "/_content/Syncfusion.Blazor"
});
}
. . . .
(more code follow)
}
|
<link rel='nofollow' href="_content/Syncfusion.Blazor.Themes/bootstrap4.css" rel="stylesheet" /><link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" />|
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(env.ContentRootPath, "wwwroot/_content/Syncfusion.Blazor/scripts")),
RequestPath = "/_content/Syncfusion.Blazor"
});
|
|
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BlazorApp318837</title>
<base rel='nofollow' href="~/" />
<link rel="stylesheet" rel='nofollow' href="css/bootstrap/bootstrap.min.css" />
<link rel='nofollow' href="css/site.css" rel="stylesheet" />
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" />
<link rel='nofollow' href="BlazorApp318837.styles.css" rel="stylesheet" />
</head>
|
I took the sample code in the first reply of this thread. Everything works right in development mode, but when I changed it to production mode, the calendar looks strange. I hope my problem can be replicated in your computer.
Besides, the above methods are calling local nuget packages, so when I move my project from my computer to another computer without nuget, is there anything to solve the problem?
Attachment: WebApplication1_4c4f12bd.rar
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsEnvironment("Local") || env.IsEnvironment("Production") || env.IsEnvironment("Staging"))
{
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
@"C:\Users\${user-name}\.nuget\packages\syncfusion.blazor\{Version}\staticwebassets"),
RequestPath = "/_content/Syncfusion.Blazor"
});
}
. . . .
(more code follow)
}
|
|
if (env.IsEnvironment("Local") || env.IsEnvironment("Production") || env.IsEnvironment("Staging"))
{
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(env.ContentRootPath, "wwwroot/_content/Syncfusion.Blazor/scripts")),
RequestPath = "/_content/Syncfusion.Blazor"
});
}
|
Hi Peter,
Apologies for the delay in response.
We have checked the reported issue for “DirectoryNotFoundException” at our end by developing a Blazor Server App in production mode using PhysicalFileProvider, but we were unable to replicate the issue on our end. Please ensure that ${user-name} is being replaced correctly, and use the following code snippets based on the package type you are using:
Overall Package:"C:\Users\${user-name}\.nuget\packages\syncfusion.blazor\{Version}\staticwebassets"
Individual Package: "C:\Users\${user-name}\.nuget\packages\syncfusion.blazor.themes\{Version}\staticwebassets"
Additionally, we recommend updating to the latest version of both the NuGet packages and the .NET framework to help resolve the issue. For further guidance, please refer to the attached sample and the following documentation link:
Getting started with Syncfusion Blazor Web App in Visual Studio
If you are still encountering the issue, please provide the following details:
This information will help us provide a more accurate and prompt solution.
Regards,
Subathra K.