vikramlearning / blazorbootstrap-starter-templates

Blazor Bootstrap - Starter Templates (.NET 6/7/8)
https://docs.blazorbootstrap.com
24 stars 16 forks source link

Issues setting up the .NET 8 starter template #8

Closed birger-ant closed 5 months ago

birger-ant commented 6 months ago

Hi there

When running the NET8.BlazorWebAppRenderModeServerGlobal it the following error

Severity Code Description Project File Line Suppression State Error MSB4018 The "GenerateStaticWebAsssetsPropsFile" task failed unexpectedly. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Birger\Source\Repos\blazorbootstrap-starter-templates\src\BlazorBootstrap.Templates.Starter\NET8.BlazorWebAppRenderModeServerGlobal\obj\Debug\net8.0\staticwebassets\msbuild.NET8.BlazorWebAppRenderModeServerGlobal.Microsoft.AspNetCore.StaticWebAssets.props'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) at Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAsssetsPropsFile.ExecuteCore() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() NET8.BlazorWebAppRenderModeServerGlobal C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Pack.targets 136 screenshot-error-blazor8-blazorbootstrap

When following the startup guide here instead

https://docs.blazorbootstrap.com/getting-started/blazor-webapp-server-global-net-8

I get an error in the developer console

Failed to load resource: the server responded with a status of 404 () https://localhost:7066/NET8.BlazorWebAppRenderModeServerGlobal.styles.css

gvreddy04 commented 6 months ago

@birger-ant, thank you for trying BlazorBootstrap. I've understood your error.

image

In the above screenshot, the highlighted line is generated as part of the starter project. Please do not copy that line to your page. The default CSS file will be similar to your project file name. Just keep the default generated reference as is.

gvreddy04 commented 6 months ago

Hi there

When running the NET8.BlazorWebAppRenderModeServerGlobal it the following error

Severity Code Description Project File Line Suppression State Error MSB4018 The "GenerateStaticWebAsssetsPropsFile" task failed unexpectedly. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\Birger\Source\Repos\blazorbootstrap-starter-templates\src\BlazorBootstrap.Templates.Starter\NET8.BlazorWebAppRenderModeServerGlobal\obj\Debug\net8.0\staticwebassets\msbuild.NET8.BlazorWebAppRenderModeServerGlobal.Microsoft.AspNetCore.StaticWebAssets.props'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) at Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAsssetsPropsFile.ExecuteCore() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() NET8.BlazorWebAppRenderModeServerGlobal C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Pack.targets 136 screenshot-error-blazor8-blazorbootstrap

For this issue, please clean the solution and rebuild. Let me know, if you need further help.