Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/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
.net 正在调试中加载的随机模块_.net_Visual Studio 2010 - Fatal编程技术网

.net 正在调试中加载的随机模块

.net 正在调试中加载的随机模块,.net,visual-studio-2010,.net,Visual Studio 2010,当我在Visual Studio 2010中调试我的VB.NET应用程序时,在调试输出中会显示一些我不理解的内容: 'something.vshost.exe' (Managed (v4.0.30319)): Loaded 'jb3yjswu' 'something.vshost.exe' (Managed (v4.0.30319)): Loaded 'mdul5h2c' 这些被加载的随机模块(或其他什么)是什么?它们是否与正在创建的线程相关?每次调试时,名称都会更改。我建议您在适当的时候将模

当我在Visual Studio 2010中调试我的VB.NET应用程序时,在调试输出中会显示一些我不理解的内容:

'something.vshost.exe' (Managed (v4.0.30319)): Loaded 'jb3yjswu'
'something.vshost.exe' (Managed (v4.0.30319)): Loaded 'mdul5h2c'

这些被加载的随机模块(或其他什么)是什么?它们是否与正在创建的线程相关?每次调试时,名称都会更改。

我建议您在适当的时候将模块和类型从加载的程序集转储到日志文件中。然后,您可以查找神秘程序集并找到其中的类型。例如:

using System;
using System.Xml.Linq;

public class Test
{    
    static void Main()
    {
        Console.WriteLine("Before");
        DumpAssemblies();
        DoSomethingWithXml();
        Console.WriteLine("After");
        DumpAssemblies();
    }

    static void DoSomethingWithXml()
    {
        new XDocument();
    }

    static void DumpAssemblies()
    {
        Console.WriteLine("Assemblies loaded:");
        foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
        {
            Console.WriteLine("  Assembly {0}:", assembly.FullName);
            foreach (var module in assembly.GetModules())
            {
                Console.WriteLine("    Module {0}:", module.Name);
                foreach (var type in module.GetTypes())
                {
                    Console.WriteLine("      {0}", type.FullName);
                }
            }
        }
    }
}

一旦您知道哪些类型在哪些程序集中,这应该可以解释发生了什么。如果您看到神秘模块没有任何类型,或者类型没有多大意义,则需要添加更多诊断-例如,列出模块中的资源或类型中的方法等。

动态生成类型的临时程序集?可能就是这样。动态生成的类型是什么意思?我有很多自定义类型。你的项目中有lambda吗?我相信lambda和绝对匿名的类型被编译成可能会被抛出临时程序集中的类型?@Brad:你的代码中有XML序列化吗?@Brad:对,如果是这样的话,我一点也不会感到惊讶。按照我下面的诊断建议,你可能会发现。。。