locked
how to resolve Runtime Build Error in Visual Studio 2010? for VB.NET code RRS feed

  • Question

  • The "ResolveAssemblyReference" task failed unexpectedly.

    System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Illegal characters in path.

       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

       at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)

       at System.IO.Path.GetFullPathInternal(String path)

       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)

       at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)

       at Microsoft.Build.Tasks.AssemblyFoldersExCache.<>c__DisplayClass4_0.<.ctor>b__0(AssemblyFoldersExInfo assemblyFolder)

       at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()

       at System.Threading.Tasks.Task.InnerInvoke()

       at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

       at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )

       --- End of inner exception stack trace ---

       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)

       at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)

       at System.Threading.Tasks.Task.Wait()

       at 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)

       at 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)

       at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)

       at Microsoft.Build.Tasks.AssemblyFoldersExCache..ctor(AssemblyFoldersEx assemblyFoldersEx, FileExists fileExists)

       at Microsoft.Build.Tasks.AssemblyFoldersExResolver.LazyInitialize()

       at 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)

       at 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)

       at Microsoft.Build.Tasks.ReferenceTable.ResolveReference(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Reference reference)

       at Microsoft.Build.Tasks.ReferenceTable.ResolveAssemblyFilenames()

       at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure()

       at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure(DependentAssembly[] remappedAssembliesValue, ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)

       at 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)

       at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()

       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()

       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

    ---> (Inner Exception #0) System.ArgumentException: Illegal characters in path.

       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

       at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)

       at System.IO.Path.GetFullPathInternal(String path)

       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)

       at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)

       at Microsoft.Build.Tasks.AssemblyFoldersExCache.<>c__DisplayClass4_0.<.ctor>b__0(AssemblyFoldersExInfo assemblyFolder)

       at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()

       at System.Threading.Tasks.Task.InnerInvoke()

       at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

       at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )<---

     

    ---> (Inner Exception #1) System.ArgumentException: Illegal characters in path.

       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

       at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)

       at System.IO.Path.GetFullPathInternal(String path)

       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)

       at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)

       at Microsoft.Build.Tasks.AssemblyFoldersExCache.<>c__DisplayClass4_0.<.ctor>b__0(AssemblyFoldersExInfo assemblyFolder)

       at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()

       at System.Threading.Tasks.Task.InnerInvoke()

       at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

       at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )<---

    Tuesday, August 1, 2017 9:27 AM

All replies

  • Hi Ghouse,

    Based on your thread title, you have these errors message when you run your vb.net project? If yes, please post some code that can reproduce your issue here, it is beneficial to us to analyze your issue.

    Thanks fro your understanding.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 2, 2017 5:48 AM
  • Hi Cherry,

    My same application was working fine one month before, but now the same application without any code changes causes the problem. I'm trying to fix this issue over Last one Month.

    Thanks & Regards,

    Ghouse Ahmed


    Wednesday, August 2, 2017 9:35 AM
  • Hi Ghouse,

    Have you resolved this issue now? If yes, please share your solution here, it is beneficial to other community members who face then same issue. If not, you may need provide some code that can reproduce this issue here, It is difficult for us to judge the source of the error based on these error messages.

    Thanks for your understanding.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 9, 2017 8:23 AM
  • I see "Illegal characters in path" throughout so an guess is the problem has to do with some type of file operation yet without code it's impossible to tell. 

    I would suggest if you can reproduce the issue in your development environment is to set break-points, step through your code and inspect looking for external file information that may be causing the issue.

    Bottom line, if there are no code changes the issue must be external.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, August 9, 2017 8:30 AM