1

我将尽力解释这一点......我目前正在与一些同学一起使用 React 前端开发 ASP.Net Core 应用程序。当我们将 ClientApp(来自 CRA)放入我们的 Web 应用程序文件夹时,一切似乎都很好。重要说明:项目已连接到 Git,这可能需要考虑。1)我会先运行 API 来开始这个项目。(运行 IISExpress)。2)我会将我的ClientApp打开到Visual Studio Code中,然后在VSCode的终端中“启动”。服务器启动并运行良好...... 3)我有一个朋友开始实时分享,我们开始在前端项目中工作。3)最后想重启整个项目,于是关闭了FRrontend项目,停止了后端Api代码。4) 关闭 -> 然后在 Visual Studio 中重新打开解决方案,这就是我的 WebApi 的样子。

![Solution Explorer] https://i.imgur.com/0M9x4cp.png ![WebApi 的原始文件夹结构] https://i.imgur.com/PMnwC3z.png

[VS 留言] https://i.imgur.com/v4KexG6.png

日志文件:

2019 年 10 月 5 日下午 4:41:28 LimitedFunctionality System.AggregateException:发生一个或多个错误。---> System.ArgumentException:路径中有非法字符。在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) 在 System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) 在 Microsoft.VisualStudio.PlatformUI.Packages.FileChange.DefaultFileSystem。 Microsoft.VisualStudio.Services.FileChangeService.AdviseFileChangeCore(String filename, _VSFILECHANGEFLAGS filter, EventSinkBundle bundle, CancellationToken token) 的 Microsoft.VisualStudio.Services.FileChangeService.ValidateAndNormalize(String path, String paramName) 的 PathWrapper.GetFullPath(String path)。 VisualStudio.服务。2 func) at Microsoft.VisualStudio.Services.FileChangeService.AdviseFileChangeAsync(String filename, _VSFILECHANGEFLAGS filter, IVsFreeThreadedFileChangeEvents2 sink, CancellationToken cancellationToken) at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.FileWatching.FileWatchProjectReevaluationService.<HandleFileCollectionChangedAsync>d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim1.d__5.MoveNext() --- 从先前引发异常的位置结束堆栈跟踪 --- 在 Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex) 在 Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0 .b__0() 在 Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.g__action|0() 在 GuardMethodClass.GuardMethod(Func 1 , Func2 , Func2 ) --- End of inner exception stack trace --- ---> (Inner Exception #0) System.ArgumentException: Illegal characters in path. at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) at Microsoft.VisualStudio.PlatformUI.Packages.FileChange.DefaultFileSystem.PathWrapper.GetFullPath(String path) at Microsoft.VisualStudio.Services.FileChangeService.ValidateAndNormalize(String path, String paramName) at Microsoft.VisualStudio.Services.FileChangeService.AdviseFileChangeCore(String filename, _VSFILECHANGEFLAGS filter, EventSinkBundle bundle, CancellationToken token) at Microsoft.VisualStudio.Services.FileChangeService.<>c__DisplayClass86_0.<AdviseFileChangeAsync>b__0(CancellationToken token) at Microsoft.VisualStudio.Services.FileChangeService.RunWithTracingAsync[T](CompletionTracer tracer, CancellationToken token, Func2 func) 在 Microsoft.VisualStudio.ProjectSystem.VS.Implementation.FileWatching.FileWatchProjectReevaluationService.d__18.MoveNext() 的 Microsoft.VisualStudio.Services.FileChangeService.AdviseFileChangeAsync(String filename, _VSFILECHANGEFLAGS filter, IVsFreeThreadedFileChangeEvents2 sink, CancellationToken cancelToken) --- End堆栈跟踪从以前抛出异常的位置 --- System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim 1.<ProcessInputQueueAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex) at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0() at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0() at GuardMethodClass.GuardMethod(Func1 , 功能2 , Func2)<---

=================== 10/5/2019 4:41:29 PM Recoverable System.AggregateException:发生了一个或多个错误。---> System.ArgumentException:路径中有非法字符。在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) 在 System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) 在 System.IO.FileInfo.Init(String fileName, Boolean checkHost) 在 System.IO.FileInfo..ctor(String fileName) 在 Microsoft.AspNetCore.Razor.Language.DefaultRazorProjectFileSystem.GetItem(String path, String fileKind) 在 Microsoft.CodeAnalysis.Razor.ProjectSystem.ProjectState.GetImportDocumentTargetPaths(HostDocument hostDocument)在 Microsoft.CodeAnalysis.Razor.ProjectSystem.ProjectState。1 loader) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultProjectSnapshotManager.DocumentAdded(HostProject hostProject, HostDocument document, TextLoader textLoader) at Microsoft.CodeAnalysis.Razor.ProjectSystem.RazorProjectHostBase.AddDocumentUnsafe(HostDocument document) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<>c__DisplayClass7_1.<OnProjectChanged>b__2() at Microsoft.CodeAnalysis.Razor.ProjectSystem.RazorProjectHostBase.<UpdateAsync>d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<>c__DisplayClass7_0.<<OnProjectChanged>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.RazorProjectHostBase.<ExecuteWithLock>d__23.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<>c__DisplayClass7_0.<<OnProjectChanged>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.<>c__DisplayClass14_1.<<LoadedProjectAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<OnProjectChanged>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex) at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0() at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0() at GuardMethodClass.GuardMethod(Func1、功能2 , Func2 ) --- 内部异常堆栈跟踪结束 --- ---> (Inner Exception #0) System.ArgumentException: 路径中有非法字符。在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath) 在 System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath) 在 System.IO.FileInfo.Init(String fileName, Boolean checkHost) 在 System.IO.FileInfo..ctor(String fileName) 在 Microsoft.AspNetCore.Razor.Language.DefaultRazorProjectFileSystem.GetItem(String path, String fileKind) 在 Microsoft.CodeAnalysis.Razor.ProjectSystem.ProjectState.GetImportDocumentTargetPaths(HostDocument hostDocument)在 Microsoft.CodeAnalysis.Razor.ProjectSystem.ProjectState.WithAddedHostDocument(HostDocument 主机文档,Func1 loader) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultProjectSnapshotManager.DocumentAdded(HostProject hostProject, HostDocument document, TextLoader textLoader) at Microsoft.CodeAnalysis.Razor.ProjectSystem.RazorProjectHostBase.AddDocumentUnsafe(HostDocument document) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<>c__DisplayClass7_1.<OnProjectChanged>b__2() at Microsoft.CodeAnalysis.Razor.ProjectSystem.RazorProjectHostBase.<UpdateAsync>d__17.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<>c__DisplayClass7_0.<<OnProjectChanged>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.RazorProjectHostBase.<ExecuteWithLock>d__23.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<>c__DisplayClass7_0.<<OnProjectChanged>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.<>c__DisplayClass14_1.<<LoadedProjectAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__68.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultRazorProjectHost.<OnProjectChanged>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex) at Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0() at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0() at GuardMethodClass.GuardMethod(Func1 , 功能2 , Func2)<---

====================

4

0 回答 0