Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wcf Type.GetType(“System.ServiceModel.BasicHttpBinding”返回null_Wcf_Reflection_Basichttpbinding_Gettype - Fatal编程技术网

Wcf Type.GetType(“System.ServiceModel.BasicHttpBinding”返回null

Wcf Type.GetType(“System.ServiceModel.BasicHttpBinding”返回null,wcf,reflection,basichttpbinding,gettype,Wcf,Reflection,Basichttpbinding,Gettype,我想知道为什么我需要传递AssemblyQualifiedName来创建基本http绑定的任何实例。我在ServiceModel.EndPointAddress中看到了相同的行为 当我传递程序集名称时,它返回null string binding=“System.ServiceModel.BasicHttpBinding”; Type.GetType(binding);//返回null 如果我通过了AssemblyQualifiedName,它工作正常 string binding=“Syste

我想知道为什么我需要传递AssemblyQualifiedName来创建基本http绑定的任何实例。我在ServiceModel.EndPointAddress中看到了相同的行为

当我传递程序集名称时,它返回null

string binding=“System.ServiceModel.BasicHttpBinding”; Type.GetType(binding);//返回null

如果我通过了AssemblyQualifiedName,它工作正常

string binding=“System.ServiceModel.BasicHttpBinding,System.ServiceModel,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a561934e089”;
GetType(binding);返回对象

,这就是
GetType
被记录为使用的对象,除非该类型是核心类型,或者是当前正在执行的程序集

参数

字体名

类型:System.String

要获取的类型的程序集限定名。请参阅 AssemblyQualifiedName。如果类型位于当前正在执行的 在Mscorlib.dll中,提供类型名就足够了 由其命名空间限定