在一个源码的操作 config 文件的例子中看到这么一段代码 不明白什么意思,我自己制作了一个test 文件和一个程序集文件 在里面加上这句话  但是调试的时候提示 未被实例化 调试 显示Assembly.GetEntryAssembly() 是一个空值
 请问
 1、                 docName = ((Assembly.GetEntryAssembly()).GetName()).Name;                docName += ".exe.config"; 的含义
2、我如何在我自己的文件中应用

解决方案 »

  1.   

    If you use a default namespace you must prefix the assembly name to the resource name. For example, to access an icon called "icon1.ico" in a project with a default namespace of "myproject", use the name "myproject.icon1.ico". In both Visual Basic .NET and C#, new projects have a default namespace—Visual Studio uses the project name by default. You can remove or change the default namespace by right-clicking the project item in the Solution Explorer and selecting Properties from the popup menu. The default namespace appears under the Common Properties, General item (see Figure 1). In VB.NET, it's the "root namespace"; in C# it's called the "default namespace".Figure 1: Use the Visual Studio Project properties dialog to remove or change the default project namespace.
      

  2.   

    實際上你可以偷懶點把docName的值直接賦成編譯生成的可執行文件名+".exe.config"
      

  3.   

    Assembly.GetEntryAssembly()  这个函数能不能举个例子啊