DirectoryNotFoundException with staticwebassets

Hello

After updating the version to 2.25.4, I started to receive the following error in the Blazor Server Side app.


System.IO.DirectoryNotFoundException: 'C:\Users\user\.nuget\packages\syncfusion.blazor.themes\25.2.4\staticwebassets\'


I have definitions as follows in the _Host.cshtml file.

@{

    Layout = null;

    QueryHelpers.ParseQuery(Request.QueryString.Value).TryGetValue("theme", out var themeName);

    themeName = themeName.Count > 0 ? themeName.First() : "bootstrap5";

}

 <link rel='nofollow' href=@("_content/Syncfusion.Blazor.Themes/" + themeName + ".css") rel="stylesheet" />

<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>


Thank you for your help.


1 Reply

SK Subathra Kaliamoorthy Syncfusion Team May 17, 2024 01:19 PM UTC

Hi Seckin,


Greetings from Syncfusion Support!


Based on the provided details, we have developed a Blazor Server Side App targeting .NET 7.0 and implemented our Syncfusion Blazor Component by defining theme stylesheet and script which can be accessed from NuGet through Static Web Assets for the latest version (v25.2.4) and were unable to replicate the System.IO.DirectoryNotFoundException issue at our end.


However, we suspect that you may have missed to install the "Syncfusion.Blazor.Themes" packages in your application. Please note that when you are using individual NuGet packages for component, you have to manually install the "Syncfusion.Blazor.Themes" packages. Please check the attached sample and release notes for your reference.


https://blazor.syncfusion.com/documentation/release-notes/20.1.47?type=all#breaking-changes


Furthermore, we suggest the following steps to potentially resolve the issue:

  • Delete the "bin" and "obj" folders.
  • Clear the NuGet cache.


After completing these steps, please verify if the issue persists. If it does, we kindly request that you share your replication sample or code, if possible, for further investigation.


Regards,

Subathra K.


Attachment: BlazorDirectoryException_76eb701d.zip

Loader.
Up arrow icon