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

TOPIC:

C# project used from X# opens metadata 13 Sep 2022 23:25 #23803

  • ic2
  • ic2's Avatar
  • Topic Author


  • Posts: 1608
  • In X# we have this code:
    Local oiConC As IC2CSMethods.iConnectC
    	oiConC := IC2CSMethods.iConnectC{}
            oiConC:DoSomething()

    Now when I use Goto Definition it opens a locked file saying // Metadata taken from assembly and then the DLL.
    Of course this is wrong. It should go to the C# method DoSomething which is in a separate project but the same solution.

    I see multiple posts over the years what the problem usually is and of course it has never been fixed:

    The problem begins when you added the reference to the DLL and not to the project... In this case VS will remember forever that and will always open 'from metadata' even you changed the reference from DLL to project... The only way I now of, is manually editing the project file and remove the DLL reference...


    However, I removed the below XML from the project file and on re-opening the solution it was back and nothing changed. Plus that I would say that it is the correct reference, to the actual C# project. But that does not seems to be used. Even if I unload the C# project in the solution, the X# program using the C# method(s) still compiles without error (and keeps showing the metadata).

    How can I solve this?

    Dick

    <ItemGroup>
    <ProjectReference Include="IC2CSMethods\IC2CSMethods.csproj">
    <Name>IC2CSMethods</Name>
    <Project>{f6d8ba6c-be7e-4846-bbd0-f9a5dd176302}</Project>
    <Private>True</Private>
    </ProjectReference>
    </ItemGroup>

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

    C# project used from X# opens metadata 13 Sep 2022 23:35 #23805

    • Chris
    • Chris's Avatar


  • Posts: 3843
  • Hi Dick,

    I think you can't solve this yourself, instead we need to make the X# project system "smarter" and open the c# source code. I don't know how easy or difficult it is to do this, but will open a report for Robert to look into it.
    XSharp Development Team
    chris(at)xsharp.eu

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

    C# project used from X# opens metadata 14 Sep 2022 08:35 #23807

    • robert
    • robert's Avatar


  • Posts: 3446
  • Dick,

    In X# we have this code:
    Local oiConC As IC2CSMethods.iConnectC
    	oiConC := IC2CSMethods.iConnectC{}
            oiConC:DoSomething()

    Now when I use Goto Definition it opens a locked file saying // Metadata taken from assembly and then the DLL.
    Of course this is wrong. It should go to the C# method DoSomething which is in a separate project but the same solution.

    As consumer of the C# project we have no idea in which source file the class / method is defined.
    There might be a way to detect this and open the right source file (by reading the PDB file and getting the line number information from there), but for now I would like to focus on our own VS integration.

    Robert
    XSharp Development Team
    The Netherlands

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

    C# project used from X# opens metadata 14 Sep 2022 12:51 #23810

    • ic2
    • ic2's Avatar
    • Topic Author


  • Posts: 1608
  • Hello Robert,

    As consumer of the C# project we have no idea in which source file the class / method is defined.
    There might be a way to detect this and open the right source file (by reading the PDB file and getting the line number information from there), but for now I would like to focus on our own VS integration.

    Ah, ok, I thought it was some problem in the project file as I saw it in several posts.

    It's not a big deal. I was afraid that it wouldn't use changes in my C# either as the metadata is pointing to some DLL but that does seem to be working.

    Would be nice if it would work some day but I fully agree that the other Goto/Peek & tooltip issues within X# projects have priority.

    Dick

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

    Last edit: by ic2.
    • Page:
    • 1