解决 error NETSDK1005 错误
错误讯息
error NETSDK1005: Assets file '...\obj\project.assets.json' doesn't have a target for 'net50'. Ensure that restore has run and that you have included 'net50' in the TargetFrameworks for your project.
删除旧版本
> dotnet tool uninstall --global dotnet-ef
Tool 'dotnet-ef' (version '3.1.4') was successfully uninstalled.
> dotnet tool uninstall --global dotnet-aspnet-codegenerator
Tool 'dotnet-aspnet-codegenerator' (version '3.1.4') was successfully uninstalled.
安装新版本
> dotnet tool install --global dotnet-ef
You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '5.0.0') was successfully installed.
> dotnet tool install --global dotnet-aspnet-codegenerator
You can invoke the tool using the following command: dotnet-aspnet-codegenerator
Tool 'dotnet-aspnet-codegenerator' (version '5.0.0') was successfully installed.