Giter VIP home page Giter VIP logo

Comments (10)

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

The build system generates a file in the temp folder, in a subfolder MsBuildTemp<UserName>. The file is called LastXSharpResponseFile.Rsp ,
Copy this file to the folder where your project is located.
Then open a command project and navigate to that folder.
Then call xsc @LastXSharpResponseFile.Rsp
All errors will be listed to stdout. So you can redirect the output with >compiler.log and send me the log file.

from xsharppublic.

baramuse avatar baramuse commented on August 22, 2024

Here is the compiler.log but i doubt it will help you:
compiler.log

here is the ouput of xsc:

>xsc @LastXSharpResponseFile.Rsp > compiler.log

Unhandled Exception: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at LanguageService.CodeAnalysis.DiagnosticInfo.GetMessage(IFormatProvider formatProvider)
   at LanguageService.CodeAnalysis.DiagnosticFormatter.Format(Diagnostic diagnostic, IFormatProvider formatter)
   at LanguageService.CodeAnalysis.CommonCompiler.PrintError(Diagnostic diagnostic, TextWriter consoleOutput)
   at LanguageService.CodeAnalysis.CommonCompiler.<ReportDiagnostics>g__reportDiagnostic|53_0(Diagnostic diag, SuppressionInfo suppressionInfo, <>c__DisplayClass53_0& )
   at LanguageService.CodeAnalysis.CommonCompiler.ReportDiagnostics(IEnumerable`1 diagnostics, TextWriter consoleOutput, ErrorLogger errorLoggerOpt, Compilation compilation)
   at LanguageService.CodeAnalysis.CommonCompiler.RunCore(TextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken)
   at LanguageService.CodeAnalysis.CommonCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken)
   at LanguageService.CodeAnalysis.XSharp.CommandLine.Xsc.<>c__DisplayClass1_0.<Run>b__0(TextWriter tw) in E:\XSharp\Dev\src\Compiler\src\Compiler\xsc\Xsc.cs:line 54
   at LanguageService.CodeAnalysis.XSharp.CommandLine.Xsc.Run(String[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader) in E:\XSharp\Dev\src\Compiler\src\Compiler\xsc\Xsc.cs:line 56
   at LanguageService.CodeAnalysis.CommandLine.BuildClient.RunLocalCompilation(String[] arguments, BuildPaths buildPaths, TextWriter textWriter) in E:\XSharp\Dev\src\Roslyn\Src\Compilers\Shared\BuildClient.cs:line 213
   at LanguageService.CodeAnalysis.CommandLine.BuildClient.RunCompilation(IEnumerable`1 originalArguments, BuildPaths buildPaths, TextWriter textWriter, String pipeName) in E:\XSharp\Dev\src\Roslyn\Src\Compilers\Shared\BuildClient.cs:line 154
   at LanguageService.CodeAnalysis.CommandLine.BuildClient.Run(IEnumerable`1 arguments, RequestLanguage language, CompileFunc compileFunc, ICompilerServerLogger logger) in E:\XSharp\Dev\src\Roslyn\Src\Compilers\Shared\BuildClient.cs:line 98   at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.MainCore(String[] args) in E:\XSharp\Dev\src\Compiler\src\Compiler\xsc\Program.cs:line 37
   at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.Main(String[] args) in E:\XSharp\Dev\src\Compiler\src\Compiler\xsc\Program.cs:line 19

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

Basile,
This does help: it tells us that one of our error messages is either incorrectly formatted, or the GetMessage() call was called with not enough parameters. Of course that still does not tell us where the error is.
What you can do (if you want to help) is this:

  • Start a new copy of VS
  • Call the program like in the previous message, but add the command line option /shared
  • That should start the background compiler (XSCompiler.exe)
  • Inside VS Attach the Debugger to the XSCompiler.exe process
  • Goto the Window Debugger/Windows/Exception settings and Clear the checkbox in front of Common Language Runtime Exceptions
  • In the search box on the top type System.FormatException. That should show one exception. Tick the checkbox in front of the exception
  • Restart the compiler (when it has stopped running)
  • Now the debugger should stop when the exception occurs. Most likely, you can walk the call stack and see the error message that needs more parameters than are passed. Please send me that message (or the value of _errorCode) and the arguments (these are in the _arguments field of the DiagnosticInfo object)

from xsharppublic.

baramuse avatar baramuse commented on August 22, 2024

Hi Robert, of course I'm willing to help :)
While I'm navigating in the stack trace it asks for the source but it seems I'm not on the right commit as it tells me the source differs from the breakpoint.
How do I know which commit to point to? there are two 2.19.0.2 "tags" :
image

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

Basile,
You need the commit a205063 from 22/1/2024
However, you really do not need the source for this. Simply let it run and then inspect the callstack window and the locals window.
If you still want to use the source, then please in the Debugger Options remove the checkbox "Require the source files to exactly match the original version". We do some dirty tricks when building the compiler and when this option is enabled then you can not see the source.

from xsharppublic.

baramuse avatar baramuse commented on August 22, 2024

ok, but it seems I can't inspect the locals when walking the stack :
image

Here are my debug options :
image

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

Ok, then you need to send me the project folder and its dependencies.

from xsharppublic.

baramuse avatar baramuse commented on August 22, 2024

Hi Robert,

but swapping the XSharp.CodeAnalysis.dll in the GAC with the debug one from Xsharp installation folder I managed to get access to the local vars and immediate execution.
From what I follow in the callstack it seems to come from here :
image

GetArgumentToUse only returns 1 var where the message format has 2 placeholders..

Let me know if you need more or other data !

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

This is perfect. I think you have a constructor call for a typed array (something like BYTE[]{ someparameters}) with named parameters. We are creating an incorrect error message there.
Is this possible?

from xsharppublic.

cpyrgas avatar cpyrgas commented on August 22, 2024

I do not have a repro sample for this, so will let Basile confirm it.

from xsharppublic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.