Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.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
C# AppDomain.CurrentDomain.GetAssembly在服务器之间的行为不同_C#_Asp.net_Asp.net Mvc - Fatal编程技术网

C# AppDomain.CurrentDomain.GetAssembly在服务器之间的行为不同

C# AppDomain.CurrentDomain.GetAssembly在服务器之间的行为不同,c#,asp.net,asp.net-mvc,C#,Asp.net,Asp.net Mvc,我正在使用AppDomain.CurrentDomain.getAssemblys()来发现类型,但同一版本无法在一台服务器中发现它们。两台服务器安装的web应用版本相同 这是如何发生的?它将在bin文件夹中查找程序集以及探测路径;如果它们不同(web.config设置或部署的文件不同),则会得到不同的结果。@ricardopers:AppDomain.CurrentDomain.GetAssemblies()提供当前加载到AppDomain中的程序集列表。调用该方法不会加载其他程序集。当然。。

我正在使用
AppDomain.CurrentDomain.getAssemblys()
来发现类型,但同一版本无法在一台服务器中发现它们。两台服务器安装的web应用版本相同


这是如何发生的?

它将在bin文件夹中查找程序集以及探测路径;如果它们不同(web.config设置或部署的文件不同),则会得到不同的结果。@ricardopers:
AppDomain.CurrentDomain.GetAssemblies()
提供当前加载到AppDomain中的程序集列表。调用该方法不会加载其他程序集。当然。。。这很明显。@ricardopers它们具有相同的设置,部署也相同。这很奇怪。我在同一台服务器上的Type.GetCustomAttributes也有问题。