Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

C# Samples to X# 24 Nov 2019 20:40 #11902

  • Eric Selje
  • Eric Selje's Avatar
  • Topic Author


  • Posts: 31
  • At SWFox you showed a trick to convert C# examples to X#. I should have written it down--what was it?

    Thanks,

    Eric

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 24 Nov 2019 20:51 #11903

    • robert
    • robert's Avatar


  • Posts: 3599
  • Eric,

    - Download the X# language addin for ILSpy from this website
    - Compile the C# code
    - Open the assembly in ILSpy
    - Set the language to X#

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 24 Nov 2019 21:36 #11905

    • Eric Selje
    • Eric Selje's Avatar
    • Topic Author


  • Posts: 31
  • Ah, that's it thanks! I'll give it a try...

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 24 Nov 2019 21:36 #11906

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Link for ILSpy plugin DLL download page:

    www.xsharp.eu/itm-downloads?folder=general%252FTools

    Please Log in or Create an account to join the conversation.

    Last edit: by Jamal.

    C# Samples to X# 24 Nov 2019 22:59 #11907

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Robert,

    I downloaded the ILSpy project and compiled its solution, then copied the ILSpy.XSharpLanguage.Plugin.dll to ILSpy.exe directory.

    When I run the ILSpy.exe, I am getting an error that it cannot find: ICSharpCode.AvalonEdit.
    I have no issues using C# language options.

    Using ILSpy.XSharpLanguage.Plugin.dll version 1.3.65534

    Any ideas how to resolve the issue?

    Error log:
    System.IO.FileLoadException: Could not load file or assembly 'ICSharpCode.AvalonEdit, Version=6.0.253.0, Culture=neutral, PublicKeyToken=9cc39be672370310' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    File name: 'ICSharpCode.AvalonEdit, Version=6.0.253.0, Culture=neutral, PublicKeyToken=9cc39be672370310'
    at ILSpy.XSharpLanguage.XSharpHighlightingTokenWriter..ctor(TokenWriter decoratedWriter, ISmartTextOutput textOutput, XSharpOptions settings)
    at ILSpy.XSharpLanguage.XSharpLanguage.WriteCode(ITextOutput output, DecompilerSettings settings, SyntaxTree syntaxTree, IDecompilerTypeSystem typeSystem)
    at ILSpy.XSharpLanguage.XSharpLanguage.DecompileMethod(IMethod methoddef, ITextOutput output, DecompilationOptions options)
    at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput) in C:\Users\Jamal\Downloads\ILSpy-master\ILSpy\TextView\DecompilerTextView.cs:line 763
    at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass47_0.<DecompileAsync>b__0() in C:\Users\Jamal\Downloads\ILSpy-master\ILSpy\TextView\DecompilerTextView.cs:line 745

    Please Log in or Create an account to join the conversation.

    Last edit: by Jamal.

    C# Samples to X# 25 Nov 2019 07:00 #11914

    • lumberjack
    • lumberjack's Avatar


  • Posts: 721
  • Hi Jamal,

    Jamal wrote: Using ILSpy.XSharpLanguage.Plugin.dll version 1.3.65534
    Any ideas how to resolve the issue?

    You need the correct version of the Language Plugin with each ILSpy version.
    ______________________
    Johan Nel
    Boshof, South Africa

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 25 Nov 2019 07:15 #11915

    • Karl-Heinz
    • Karl-Heinz's Avatar


  • Posts: 774
  • Hi Jamal,

    I´m using the 5.0 ilspy binaries dated 19 Sep, the dll from the ILSpy5.XSharpLanguage.zip and all works as expected.

    github.com/icsharpcode/ILSpy/releases/do...aries_5.0.0.5124.zip

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 25 Nov 2019 17:28 #11923

    • Fabrice
    • Fabrice's Avatar


  • Posts: 368
  • Hi Jamal,

    strangely the V5.0 is build against AvalonEdit 6.0.253...So, this is the one I use too
    and V5.0.2 is using AvalonEdit 6.0.0... That's why the Plugin is crashing with this version.

    HTH,
    Fabrice

    Please Log in or Create an account to join the conversation.

    Last edit: by Fabrice. Reason: typo

    C# Samples to X# 25 Nov 2019 17:39 #11924

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Hi Guys,

    The ILSpy version mentioned by Karl-Heinz worked fine.

    Thanks!
    Jamal

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 25 Nov 2019 17:50 #11925

    • Jamal
    • Jamal's Avatar


  • Posts: 309
  • Hi Fabrice,

    Initially I added ILSpy as an extension from within VS 2019 and after some digging I found the cryptic folder name which VS added the extension in. Then I was looking for how to add the X# plugin from ILSpy, and was found. Then used the easier method of downloading the ILSpy master file and created the EXE, then Karl's post helped resolve the issue.

    To make the long story short, I suggest you create within the X# zip file, a readme file on the proper procedure to make the X# plugin available in ILSpy and a link to the correct versions to use.

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 25 Nov 2019 22:55 #11934

    • Fabrice
    • Fabrice's Avatar


  • Posts: 368
  • Jamal,
    the article I had published give the necessary explanation :
    www.xsharp.eu/articles/il-spy-4-5-plugin

    But you are right, I will put some information within the Zip file

    Thx,
    Fab

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 05 Mar 2020 15:24 #13596

    • mainhatten
    • mainhatten's Avatar


  • Posts: 199
  • Fabrice wrote: Jamal,
    the article I had published give the necessary explanation :
    www.xsharp.eu/articles/il-spy-4-5-plugin


    Hi Fabrice,
    currently IlSpy not installed here, but plans to do so. Read your article, went to IlSpy side.
    There are 2 bugfix releases for IlSpy5, put Oct/Nov 2019, each after the version you marked for IlSpy5.
    So I guess the xSharp plugin from ^190924 was tested againt IlSpy from^190919, whereas the changesfixes in 5.0.1 and 5.0.2 might make IlSpy safer/less crash prone. Quick question: based on your expirience would you reccommend installing the version ^190919 or the latest bugfix for IlSpy5 for use with plugin for 5?

    tia
    thomas

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 05 Mar 2020 18:30 #13600

    • Fabrice
    • Fabrice's Avatar


  • Posts: 368
  • Hi Thomas,
    thanks for your message.
    After a quick check, it seems that I will need some rebuild as the current version doesn't work with ILSpy 5.02.

    I will correct and come back asap.

    Fab

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 10 Mar 2020 22:34 #13671

    • Fabrice
    • Fabrice's Avatar


  • Posts: 368
  • Hi Thomas,
    a new DLL version is underway in order to support ILSpy 5.02....Stay tuned ;)

    Fab.

    Please Log in or Create an account to join the conversation.

    C# Samples to X# 11 Mar 2020 13:29 #13684

    • mainhatten
    • mainhatten's Avatar


  • Posts: 199
  • Fabrice wrote: a new DLL version is underway in order to support ILSpy 5.02....Stay tuned ;)


    Hi Fab,
    only 3 things to say:
    1) was nosy, tested new version in DL with 5.0.2.5153
    2) works without problem in the 15+ of test spelunking
    3) Thx a lot for the effort!

    best regards
    thomas

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1