Rider 如何处理 C# 外部依赖类

发布于 2025-01-15 18:10:33 字数 1080 浏览 1 评论 0原文

我正在尝试使用 Rider(cmd + 单击)访问外部依赖项类,并且在 Rider 的反编译过程中,我对原始源代码的代码注释消失了。有办法避免这种行为吗?我想继续看到原始源代码的注释。

这是 Rider 显示的类的打印屏幕示例,并被反编译而不是显示原始源代码:

// Decompiled with JetBrains decompiler
// Type: Example.IEncoder`1
// Assembly: Example.PlayerProfile, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9BA1395C-E8B1-420E-A723-B1994991D68B
// Assembly location: /Users/user-test/temp/example-project/ExampleClient/Library/ScriptAssemblies/Example.PlayerProfile.dll

using Google.Protobuf.Collections;
using System.Collections.Generic;

namespace Example.PlayerProfile
{
  public interface IEncoder<TPlayerProfile> where TPlayerProfile : Example.Entities.PlayerProfile {}
}

这是原始源代码,其中包含我期望在 cmd + 单击类依赖项时看到的代码注释:

using System.Collections.Generic;
using Google.Protobuf.Collections;

namespace Example.PlayerProfile
{
    /// <summary>
    /// Example of comment in code class
    /// </summary>
    public interface IEncoder<TPlayerProfile> where TPlayerProfile : Entities.PlayerProfile {}
}

I'm trying to access an external dependency class with Rider (cmd + click) and my code comments on original source code are disappearing during the decompile process by Rider. There is a way to avoid this behavior? I would like to keep seeing the comments of original source code.

Here is a print screen example of class that are showed by Rider and being decompiled instead of showing the original source code:

// Decompiled with JetBrains decompiler
// Type: Example.IEncoder`1
// Assembly: Example.PlayerProfile, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 9BA1395C-E8B1-420E-A723-B1994991D68B
// Assembly location: /Users/user-test/temp/example-project/ExampleClient/Library/ScriptAssemblies/Example.PlayerProfile.dll

using Google.Protobuf.Collections;
using System.Collections.Generic;

namespace Example.PlayerProfile
{
  public interface IEncoder<TPlayerProfile> where TPlayerProfile : Example.Entities.PlayerProfile {}
}

Here is the original source code with the code comments that I was expecting to see when cmd + click on class dependency:

using System.Collections.Generic;
using Google.Protobuf.Collections;

namespace Example.PlayerProfile
{
    /// <summary>
    /// Example of comment in code class
    /// </summary>
    public interface IEncoder<TPlayerProfile> where TPlayerProfile : Entities.PlayerProfile {}
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文