AppCode中类的namespace是否和类库的一致?

解决方案 »

  1.   

    看看appcode里面的类是否有命名空间,有是否是一致的,最好带上命名空间一起引用
      

  2.   

    先添加引用,再using,避免名字冲突,检查是否定义为public。再不行重新编译,再打开vs。
      

  3.   

    谢谢楼上二位,各位是否都试过,如果网站appcode访问程序集中的类,在bin中引用就行了,这个我试了没问题。
    类库引用网站appcode的类,各位都试过吗?是否可以?我希望得到一个肯定的回答,如果可以,应该注意什么地方?
    希望试过的高手给予解答,谢谢了!
      

  4.   


    以下是我在appcode中的部分代码:systemparam.cs
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Configuration;
    using Newtonsoft.Json;
    using System.Text;
    using System.Security.Cryptography;
    /// <summary>
    ///系统常用静态参数和方法
    /// </summary>
    public class systemparam
    {
        public static int deleted = int.Parse(ConfigurationManager.AppSettings["deleted"]);
    }
    以下是我在程序集(类库)中的代码:uu.csusing System;
    using System.Web;
    using System.Collections.Generic;
    using System.Web.SessionState;    sysbutton.Deleted = systemparam.deleted;  // 这一句中【systemparam】的错误提示为,上下文找不到“systemparam”
    到底需要引用哪些dll或命名空间,求指点!
      

  5.   

    命名空间一样么?namespace xxx
    {
        public class systemparam
        {
        }
    }
    这个是什么?和你的调用处的一样么?不同的话,先using xxx;
      

  6.   

    caozhy
    版主【caozhy】,楼上说的对吗?
    我的appcode程序中有LinQ的DataClass.dbml,每次读数据时,而我又想把读数据的程序放在程序集中,因此,必须调用DataClass.designer.cs是的表类,难道要把DataClass.dbml也放到一个程序集吗?
    再次请教权威人士给肯定回答。
      

  7.   

    还有版主,我说的类库引用网站appcode的类,各位都试过吗?是否可以?我希望得到一个肯定的回答,到底是否可以???
      

  8.   

    参见:http://bbs.csdn.net/topics/390756929
    将该类的属性-->生成操作,从“内容”改为“编译”即可调用。
    不需要引入命名空间,只要在同一命名空间即可。