求助大神!!ResolveAssemblyReference”任务意外失败。 .NET 运行的时候报这个错

xiaxr_113 2019-10-15 10:44:16
错误 1 “ResolveAssemblyReference”任务意外失败。
System.AggregateException: 发生一个或多个错误。 ---> System.ArgumentException: 路径中具有非法字符。
在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
在 System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
在 System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
在 Microsoft.Build.Tasks.AssemblyFoldersExCache.<>c__DisplayClass4_0.<.ctor>b__0(AssemblyFoldersExInfo assemblyFolder)
在 System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
在 System.Threading.Tasks.Task.InnerInvoke()
在 System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
在 System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
--- 内部异常堆栈跟踪的结尾 ---
在 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
在 System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
在 System.Threading.Tasks.Task.Wait()
在 System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
在 System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
在 System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
在 Microsoft.Build.Tasks.AssemblyFoldersExCache..ctor(AssemblyFoldersEx assemblyFoldersEx, FileExists fileExists)
在 Microsoft.Build.Tasks.AssemblyFoldersExResolver.LazyInitialize()
在 Microsoft.Build.Tasks.AssemblyFoldersExResolver.Resolve(AssemblyNameExtension assemblyName, String sdkName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& foundPath, Boolean& userRequestedSpecificFile)
在 Microsoft.Build.Tasks.AssemblyResolution.ResolveReference(IEnumerable`1 jaggedResolvers, AssemblyNameExtension assemblyName, String sdkName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& resolvedSearchPath, Boolean& userRequestedSpecificFile)
在 Microsoft.Build.Tasks.ReferenceTable.ResolveReference(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Reference reference)
在 Microsoft.Build.Tasks.ReferenceTable.ResolveAssemblyFilenames()
在 Microsoft.Build.Tasks.ReferenceTable.ComputeClosure()
在 Microsoft.Build.Tasks.ReferenceTable.ComputeClosure(DependentAssembly[] remappedAssembliesValue, ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)
在 Microsoft.Build.Tasks.ResolveAssemblyReference.Execute(FileExists fileExists, DirectoryExists directoryExists, GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, GetLastWriteTime getLastWriteTime, GetAssemblyRuntimeVersion getRuntimeVersion, OpenBaseKey openBaseKey, CheckIfAssemblyInGac checkIfAssemblyIsInGac, IsWinMDFile isWinMDFile, ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader)
在 Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()
在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
---> (内部异常 #0) System.ArgumentException: 路径中具有非法字符。
在 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
在 System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
在 System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
在 Microsoft.Build.Tasks.AssemblyFoldersExCache.<>c__DisplayClass4_0.<.ctor>b__0(AssemblyFoldersExInfo assemblyFolder)
在 System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
在 System.Threading.Tasks.Task.InnerInvoke()
在 System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
在 System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)<---
iControl.MES
...全文
586 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
正怒月神 2019-10-16
  • 打赏
  • 举报
回复
很明显的错误: System.ArgumentException: 路径中具有非法字符
exception92 2019-10-16
  • 打赏
  • 举报
回复
路径尽量使用英文
极客诗人 2019-10-15
  • 打赏
  • 举报
回复
EmulateFileIOPermissionChecks 检查路径吧
Nick_Ngai 2019-10-15
  • 打赏
  • 举报
回复
注意:System.AggregateException: 发生一个或多个错误。 ---> System.ArgumentException: 路径中具有非法字符。 调用EmulateFileIOPermissionChecks这个方法时,传的路径有问题吧。

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧