For .NET 8,如何修复“类型或命名空间名称’TimeProvider’无法找到?”

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

For .net 8, how can I fix The type or namespace name 'TimeProvider' could not be found?

问题

I found a demo to use the new .Net 8 TimeProvider class.

I installed the .Net 8 Preview.

But when I try to run the demo, code below, I get an error message: the type or namespace name 'TimeProvider' could not be found

Not sure what step I am missing.

I found the source code here: https://github.com/dotnet/runtime/pull/83604/files/a30d9629eaa94431a34cc6cb665cf289b6a8ebc9#diff-e0027dab3fd834f49597f445c9108c3f5a9570e4c2d66c8cf428d024ab61aff2

I also found this post: https://github.com/dotnet/aspnetcore/issues/47472

英文:

I found a demo to use the new .Net 8 TimeProvider class.

I installed the .Net 8 Preview.

But when I try to run the demo, code below, I get an error message: the type or namespace name 'TimeProvider' could not be found

Not sure what step I am missing.

private readonly TimeProvider _timeProvider;

public GreeterService(TimeProvider timeProvider)
{
    _timeProvider = timeProvider;
}

I found the source code here: https://github.com/dotnet/runtime/pull/83604/files/a30d9629eaa94431a34cc6cb665cf289b6a8ebc9#diff-e0027dab3fd834f49597f445c9108c3f5a9570e4c2d66c8cf428d024ab61aff2

I also found this post: https://github.com/dotnet/aspnetcore/issues/47472

答案1

得分: 1

根据我的研究,.Net 8.0.0-preview.2 的最新发布日期是 2023 年 3 月 14 日。

这个版本目前只能在 Visual Studio 2022(v17.6 预览版 1)上使用。

你提供的链接中的更新尚未发布,请等待下一次发布。

英文:

According to my research, the latest release date of .Net 8.0.0-preview.2 is March 14, 2023.

For .NET 8,如何修复“类型或命名空间名称’TimeProvider’无法找到?”

This release is currently only available on Visual Studio 2022 (v17.6 Preview 1).

The update in your link has not been released yet, please wait for the next release.

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

发表评论

匿名网友

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

确定