Closed WhitWaldo closed 10 months ago
So, here's where this stands. I closed all my VS instances and rebooted my machine and was able to delete the directory per the error message.
Ever since then, my local aspect project refuses to build with the following message locally (works fine on the build server):
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error :
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : Unhandled Exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : Parameter name: span
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.SyntaxNode.FindNode(TextSpan span, Boolean findInsideTrivia, Boolean getInnermostNodeForTie) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\Syntax\SyntaxNode.cs:line 962
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommonCompiler.MapDiagnosticToFinalCompilation(Diagnostic diagnostic, Compilation compilation, ILogWriter trace) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 2125
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommonCompiler.MapDiagnosticsToFinalCompilation(DiagnosticBag sourceDiagnostics, DiagnosticBag targetDiagnostics, Compilation compilation, ILogger logger) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 2249
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommonCompiler.CompileAndEmitImpl(TouchedFileLogger touchedFilesLogger, Compilation& compilation, ImmutableArray`1 analyzers, ImmutableArray`1 generators, ImmutableArray`1 transformers, ImmutableArray`1 plugins, ImmutableArray`1 additionalTextFiles, AnalyzerConfigSet analyzerConfigSet, ImmutableArray`1 sourceFileAnalyzerConfigOptions, ImmutableArray`1 embeddedTexts, DiagnosticBag diagnostics, ErrorLogger errorLogger, CancellationToken cancellationToken, CancellationTokenSource& analyzerCts, AnalyzerDriver& analyzerDriver, Nullable`1& generatorTimingInfo, IServiceProvider& serviceProvider, ILogger& logger) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 1598
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommonCompiler.CompileAndEmit(TouchedFileLogger touchedFilesLogger, Compilation& compilation, ImmutableArray`1 analyzers, ImmutableArray`1 generators, ImmutableArray`1 transformers, ImmutableArray`1 plugins, ImmutableArray`1 additionalTextFiles, AnalyzerConfigSet analyzerConfigSet, ImmutableArray`1 sourceFileAnalyzerConfigOptions, ImmutableArray`1 embeddedTexts, DiagnosticBag diagnostics, ErrorLogger errorLogger, CancellationToken cancellationToken, CancellationTokenSource& analyzerCts, AnalyzerDriver& analyzerDriver, Nullable`1& generatorTimingInfo) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 1385
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommonCompiler.RunCore(TextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 1113
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommonCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 735
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc.<>c__DisplayClass1_0.<Run>b__0(TextWriter tw) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Shared\Csc.cs:line 28
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommandLine.ConsoleUtil.RunWithUtf8Output[T](Func`2 func) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Core\CommandLine\ConsoleUtil.cs:line 26
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CSharp.CommandLine.Csc.Run(String[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Shared\Csc.cs:line 28
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommandLine.BuildClient.RunLocalCompilation(String[] arguments, BuildPaths buildPaths, TextWriter textWriter) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Shared\BuildClient.cs:line 198
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommandLine.BuildClient.RunCompilation(IEnumerable`1 originalArguments, BuildPaths buildPaths, TextWriter textWriter, String pipeName) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Shared\BuildClient.cs:line 164
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CommandLine.BuildClient.Run(IEnumerable`1 arguments, RequestLanguage language, CompileFunc compileFunc, CompileOnServerFunc compileOnServerFunc, ICompilerServerLogger logger) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\Shared\BuildClient.cs:line 105
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CSharp.CommandLine.Program.MainCore(String[] args) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\CSharp\csc\Program.cs:line 39
1>C:\Users\whit_\.nuget\packages\metalama.compiler\2023.3.2-preview\tasks\net472\Microsoft.CSharp.Core.targets(80,5): error : at Microsoft.CodeAnalysis.CSharp.CommandLine.Program.Main(String[] args) in C:\buildAgent\work\62cb8f15a7eb0a2e\src\Compilers\CSharp\csc\Program.cs:line 20
I tried uninstalling the NuGet package and reinstalling it (2023.3.2-preview) and I still see the same error (no new crash reports appearing).
Only by downgrading to 2023.3.1-preview does the error finally go away and let the project build locally without any other change to the aspect.
Thanks for reporting. We will take a look at both problems.
For the ArgumentOutOfRangeException
in Metalama.Compiler, do you have any more information about what's triggering the bug?
Not a clue - it kept pointing at the .targets build file, but nothing in there seemed out of the norm. Again, identical code checked into the build server built without issue - presumably it only stopped working locally because I'd deleted the directory I'd been directed to in the earlier message, so maybe some dependency on that?
Locally though, I was only able to get it to build again (again, no changes to the aspect itself, just a Nuget package swap) by installing the latest .1-preview and abandoning the .2-preview altogether.
Solved in 2023.3.4-preview.
I've got an aspect that builds locally without issue. I'm attempting to apply it to a target class in another assembly.
Unfortunately, when I either build the project or attempt to view the Metalama diff, I receive the following exception:
Severity Code Description Project File Line Suppression State Error LAMA0001 Unexpected exception occurred in Metalama: 'The directory 'C:\Users\whit\AppData\Local\Temp\Metalama\CompileTime\Metalama.Extensions.DependencyIn.netstandard2.0\fee825c088590cea\2023.3.2-preview' is in invalid state. Terminate all build processes, delete the directory and retry the build. Exception details are in 'C:\Users\whit\AppData\Local\Temp\Metalama\CrashReports\2023.3.2-preview\exception-798851a7-d8c3-4f42-a24d-acb943960bae.txt'. Please report this issue at https://www.postsharp.net/support and attach this file to the ticket. You may want to remove sensitive data from the report. UserManager C:\Users\whit_\source\repos...\UserManager\CSC 1 Active
There are only two files in that directory:![image](https://github.com/postsharp/Metalama/assets/2238529/68ef02d0-4965-45d7-b87d-61f57982ec6c)
Apparently I'm unable to delete them without closing the entire VS process, which makes this a very annoying bug.
Here's the larger stack trace from the exception:
And the crash report: