57772@LAPTOP-V9Q7BD1V MINGW64 ~/Desktop/xx/api
$ dotnet new sln --name MySolution
System.UnauthorizedAccessException: Access to the path 'C:\Users\57772\.dotnet\6.0.408.toolpath.sentinel' is denied.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.File.Create(String path)
at Microsoft.Extensions.EnvironmentAbstractions.FileWrapper.CreateEmptyFile(String path)
at Microsoft.DotNet.Configurer.FileSystemExtensions.<>c__DisplayClass0_0.<CreateIfNotExists>b__0()
at Microsoft.DotNet.Cli.Utils.FileAccessRetrier.RetryOnIOException(Action action)
at Microsoft.DotNet.Configurer.FileSystemExtensions.CreateIfNotExists(IFileSystem fileSystem, String filePath)
at Microsoft.DotNet.Configurer.FileSentinel.Create()
at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IAspNetCertificateSentinel aspNetCertificateSentinel, IFileSentinel toolPathSentinel, Boolean isDotnetBeingInvokedFromNativeInstaller, DotnetFirstRunConfiguration dotnetFirstRunConfiguration, IEnvironmentProvider environmentProvider, Dictionary`2 performanceMeasurements)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
你把报错复制出来发给我看一下
有几种可能的原因和解决方法:
权限问题:请确保当前登录的用户具有访问该路径的权限。您可以尝试以管理员身份运行命令提示符或终端,并再次运行命令。
防病毒软件或安全软件:某些防病毒软件或安全软件可能会阻止对敏感文件或目录的访问。您可以尝试禁用防病毒软件或安全软件,并再次运行命令。
文件锁定:可能存在其他进程或服务正在访问该文件或目录,并将其锁定,因此导致访问被拒绝。您可以尝试重新启动计算机,以确保没有其他进程锁定该文件或目录。
WebApi多版本管控和插件式开发(一)——WebApi服务搭建
WebApi多版本管控和插件式开发(二)——WebApi多版本管控
WebApi多版本管控和插件式开发(三)——WebApi插件式开发
附上源码:https://download.csdn.net/download/xy596356456/12864960