惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Y
Y Combinator Blog
Engineering at Meta
Engineering at Meta
D
Docker
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
腾讯CDC
P
Proofpoint News Feed
A
About on SuperTechFans
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
MyScale Blog
MyScale Blog
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
G
Google Developers Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - Jason.Yi

vs2005代码区出现问题 吉他自录之《回忆组曲》 吉他自录之《爱的罗曼史》 求助:Vs2005 asp.net development server未能开始侦听端口 为什么我的Cookie只能更新一个键值? 对Graphics.DrawImageUnscaledAndClipped的疑虑 哪些原因可能导致SQL操作操时呢? 二个算法题,大家有兴趣来看看 关于博客园的Calendar 费解的.net2.0中的ObjectDataSource控件 FormView在什么情况下自动生成模板项? 生成随机的颜色值 错误:已在多处定义 为什么本地sqlservr.exe进程占用内存如此之大? 这样的页面该如何实现? 简单的生成登录验证码的程序 遇到一个很奇怪的问题 连接SQL Server2005出错 能在web.config里做这样的配置吗?
远程机器上无法用Assembly.Load(path).CreateInstance(ClassN...
Jason.Yi · 2007-08-03 · via 博客园 - Jason.Yi

项目用到工厂模式
public static IDocument CreateIDocument()
        {
            string ClassName = path + ".DocumentSQLDAL";
            return (IDocument)Assembly.Load(path).CreateInstance(ClassName);
        }
这段代码在本地运行一切正常,
但同样的代码用Remoting之后,就发生异常:
System.NullReferenceException: 未将对象引用设置到对象的实例。
   在 Config..ctor()
   在 Config.get_Instance()
   在 DAL.SQLServer.DocumentSQLDAL..ctor()
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   在 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   在 System.Activator.CreateInstance(Type type, Boolean nonPublic)
   在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   在 System.Reflection.Assembly.CreateInstance(String typeName)
这是为何?