BlazorStrap 服务器在 .NET 6 上无法工作。

huangapple go评论63阅读模式
英文:

BlazorStrap Server not working with .NET 6

问题

services.AddBootstrapCss();
services.AddScoped<ILoggerRepository, LoggerRepository>();
services.AddBootstrapCss();
services.AddScoped<ILoggerRepository, LoggerRepository>();
英文:
services.AddBootstrapCss();
services.AddScoped&lt;ILoggerRepository, LoggerRepository&gt;();

My IDE complains that AddBootstrapCss

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS1061	&#39;IServiceCollection&#39; does not contain a definition for &#39;AddBootstrapCss&#39; and no accessible extension method &#39;AddBootstrapCss&#39; accepting a first argument of type &#39;IServiceCollection&#39; could be found (are you missing a using directive or an assembly reference?)	

Reference
https://blazorstrap.io/V1/

This is a .NET Core 5 to .NET Core 6 upgrade so I am not sure what the replacement would be for this.

答案1

得分: 1

经过测试,我发现问题的原因是官方文档尚未更新。在 Blazorstrap 版本 <= 1.5.1 中支持 AddBootstrapCss。

BlazorStrap 服务器在 .NET 6 上无法工作。

在最新文档中,快速使用教程未更新,但我找到了一个示例,官方链接已失效,你可以参考这个存储库

英文:

After testing, I found that the cause of the problem is that the official documentation has not been updated. AddBootstrapCss is supported when blazorstrap is in version <= 1.5.1.

BlazorStrap 服务器在 .NET 6 上无法工作。

In the latest document, there is no update in the quick use tutorial, but I found a sample whose official link is invalid, you can refer to this repo.

huangapple
  • 本文由 发表于 2023年4月4日 07:17:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75924379.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定