question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include [TypeForwardedTo] in a.html

See original GitHub issue

I’m trying to make Ref12 support .Net Core projects.

However, many members (eg, System.Span<>) are defined in System.Runtime the reference assembly, but is forwarded (via [TypeForwardedTo]) to System.Private.CoreLib in the actual source.

Ref12 only sees it as being in System.Runtime, so it opens https://source.dot.net/System.Runtime/Ad.html#d2517139cac388e8, which does nothing.

Can you please change the indexer to process [TypeForwardedTo] attributes and generate links to either the filename or the corresponding a.html in the target project?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Gav-Browncommented, Feb 28, 2019

@KirillOsenkov, @SLaks can probably describe it better than I can, but the following code illustrates what I see.

  1. Install the Ref12 Visual Studio extension.
  2. Create a new solution with each dll type below.
  3. Paste in the same code to each project.
using System.IO;

namespace SomeDll
{
    public class Class1
    {
        public static void TestRef12()
        {
            string a = Path.Combine("hi", "there");
        }
    }
}

  1. Right click on Path.Combine
  2. Select ‘Goto Definition’

.NET Framework dll

Expected: Opens ReferenceSource website on ‘Combine’ method (.NET Framework version).

Actual: Works as expected and opens

https://referencesource.microsoft.com/#mscorlib/system/io/path.cs,2d7263f86a526264

.NET Core dll

Expected: Opens source.dot.net website on ‘Combine’ method (.NET Core version).

https://source.dot.net/#System.Private.CoreLib/shared/System/IO/Path.cs,2d7263f86a526264,references

Actual: Opens Metadata

#region Assembly System.Runtime.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.2.0\ref\netcoreapp2.2\System.Runtime.Extensions.dll
#endregion

.NET Standard dll

Expected: Opens ReferenceSource or source.dot.net website on ‘Combine’ method.

Actual: Opens Metadata

#region Assembly netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
// C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\ref\netstandard.dll
#endregion

In this case there is no “source” but perhaps Ref12 could be enhanced to select a default implementation to show? .NET Framework or .NET Core source? I would certainly find this more useful than just the metadata.

Hope this helps.

1reaction
KirillOsenkovcommented, Jun 1, 2019

Apologies I never followed up.

I’m not sure how to get from System.Runtime.Extensions.dll reference assembly to System.Private.CoreLib. There isn’t a TypeForwardedTo attribute that would bridge the two.

I’ll ask around and see what can be done here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Assembly vs NameSpace and related to ...
Hello Experts: I am facing a problem with TypeForewodedToAttribute, Clarify, what is the Assembly and what is namespace ?
Read more >
.NET type forwarding
CLR has an equivalent of HTTP redirect for types, it is called You can move a class from one assembly to another, it...
Read more >
TypeForwardedTo, explicitly implemented interfaces and ...
Foo.csproj takes a project reference to NewFoo.csproj and I add the forwarding attribute: [assembly: TypeForwardedTo(typeof(IFooInterface))].
Read more >
[API Proposal]: JavaScript interop with [JSImport ...
Currently we don't have public C# API to do so. We propose this API together with prototype of the implementation. Key features are:....
Read more >
󠀠󠀠󠀠 Brenton House - Digital Strategist - Moving a Type from one ...
In the old assembly, add a reference to the new assembly. Add [assembly: TypeForwardedTo(typeof(YourClassName))] to the old assembly; Recompile and redeploy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found