英文:
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)上使用。
你提供的链接中的更新尚未发布,请等待下一次发布。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论