zoukankan      html  css  js  c++  java
  • 引用同一个项目中的类库,如何避免 goToDefinition时不能到达真正的定义类

    新建一个解决方案: Api

    添加类库 APi.Data

    APi.Data 新建一个 Entity

    public class Entity
    {
    private int id;
    public int Id
    {
    get { return id; }
    set { id = value; }
    }

    private string name;
    public string Name
    {
    get { return name; }
    set { name = value; }
    }
    }



    添加类库 APi.Web

    引用 APi.Data.dll

    APi.Web下 

      APi.Data.Entity t = new APi.Data.Entity();

      

      Entity的goToDefinition

      结果是:

      

    using System;
    
    namespace APi.Data
    {
        public class Entity
        {
            public Entity();
            public int Id { get; set; }
            public string Name { get; set; }
        }
    
    }
    

      

    而不是:

    using System;
    
    using System.Collections.Generic;
    
    using System.Linq;
    
    using System.Text;
    
    
    namespace Api.Data
    {
        public class Entity
        {
            private int id;
            public int Id
            {
                get { return id; }
                set { id = value; }
    
            }
            private string name;
            public string Name
            {
                get { return name; }
                set { name = value; }
            }
        }
    }
    

      

  • 相关阅读:
    c# 键值数据保存XML文件
    c# 封装 Request操作类
    c# 获取客户端IP
    c#封装DBHelper类
    c# Cache 使用实例
    c#cookie读取写入操作
    c# Session写入读取操作
    ABAP-HTTP支持
    WDA-文档-基础篇/进阶篇/讨论篇
    UI5-文档-4.38-Accessibility
  • 原文地址:https://www.cnblogs.com/needrunning/p/2212323.html
Copyright © 2011-2022 走看看