【发布时间】:2020-06-25 07:26:19
【问题描述】:
当我尝试在 VScode 中创建一个新的 C# 项目时,我遇到了错误。我该如何解决?
这是我的命令:
PS C:\Users\lau\Documents\code\c#> dotnet new console
这是错误信息:
无法创建模板“控制台应用程序”。出错时 处理文件 /content/ConsoleApplication-CSharp/Company.ConsoleApplication1.csproj System.IO.FileNotFoundException:找不到文件 'C:\Users\lau\Documents\code\c#\c#.csproj'。文件名: 'C:\Users\lau\Documents\code\c#\c#.csproj' 在 System.IO.FileStream.ValidateFileHandle(SafeFileHandle 文件句柄) 在 System.IO.FileStream.CreateFileOpenHandle(文件模式模式,文件共享 共享,FileOptions 选项)在 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess 访问、FileShare 共享、Int32 bufferSize、FileOptions 选项) 在 System.IO.FileStream..ctor(字符串路径,FileMode 模式,FileAccess 访问,文件共享共享,Int32 bufferSize)在 System.IO.File.Create(字符串路径)在 Microsoft.TemplateEngine.Utils.PhysicalFileSystem.CreateFile(字符串 路径)在 Microsoft.TemplateEngine.Core.Util.Orchestrator.ProcessFile(IFile sourceFile,字符串 sourceRel,字符串 targetDir,IGlobalRunSpec 规范, IProcessor 后备,IEnumerable
1 fileGlobProcessors, IReadOnlyList1 位置操作)
【问题讨论】:
-
你的 'C:\Users\lau\Documents\code\c#' 目录是空的吗?
-
是的,它是空的
-
尝试为您的根文件夹 /hello>dotnet 新控制台使用其他名称而不是 c#。或者您在该文件夹上存在权限问题
标签: c# visual-studio-code