显然在没有建立ApplicationPool的情况下 用Class2.cs的类会出现: The type or namespace name 'xxx' could not be found 用Class2.cs的名字空间会出现: CS0234: The type or namespace name 'xxx' does not exist in the class or namespace 'Cfg' (are you missing an assembly reference?) 的情况嘛。文件都是被单独编译的,它怎么会知道这个东东是在哪个文件里。
you can use System.Reflection like this http://dev.csdn.net/develop/article/23/23536.shtm
用Class2.cs的类会出现:
The type or namespace name 'xxx' could not be found
用Class2.cs的名字空间会出现:
CS0234: The type or namespace name 'xxx' does not exist in the class or namespace 'Cfg' (are you missing an assembly reference?)
的情况嘛。文件都是被单独编译的,它怎么会知道这个东东是在哪个文件里。
http://dev.csdn.net/develop/article/23/23536.shtm
<%@ Assembly Src="Class2.cs" %>这样做不是很方便的吗?
Assembly ass=Assembly.LoadFrom(Server.MapPath(this.ddlType.SelectedItem.Value));
// 获取类型
Type tp=ass.GetType("MyNamespace.MyClass");
// 获取方法
MethodInfo mi=tp.GetMethod("MyMethodl");
// 创建实例
Object obj=System.Activator.CreateInstance(tp);
2.再使用using Class1;
不能建ApplicationPool的情况下,项目设置是没有任何作用的。