Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/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
.net 如何使用CodeDom设置AssemblyName?_.net_Vb.net_Reflection_Codedom - Fatal编程技术网

.net 如何使用CodeDom设置AssemblyName?

.net 如何使用CodeDom设置AssemblyName?,.net,vb.net,reflection,codedom,.net,Vb.net,Reflection,Codedom,我正在使用codedom从自己的代码动态创建一个EXE 我可以设置所有属性,如标题、描述、公司。。。但是我无法设置程序集名称。有什么办法吗?下面是我在类前面添加的代码部分: Imports System.Reflection 'This works but the AssemblyName is set to the name of the exe file: 'If I rename the exe the assembly name also changes. <Assembly: S

我正在使用codedom从自己的代码动态创建一个EXE

我可以设置所有属性,如标题、描述、公司。。。但是我无法设置程序集名称。有什么办法吗?下面是我在类前面添加的代码部分:

Imports System.Reflection
'This works but the AssemblyName is set to the name of the exe file:
'If I rename the exe the assembly name also changes.
<Assembly: System.Reflection.AssemblyTitle("Title123"> )
<Assembly: System.Reflection.AssemblyDescription("Description123">)
<Assembly: System.Reflection.AssemblyCompany("qxxx enterprises">)


'I tried to add the following but it throws me an error
'"AssemblyName" cannot be used as an attribute because it does not inherit from 'System.Attribute'
<Assembly: System.Reflection.AssemblyName("Testapp123"> )
导入系统反射
'这可以工作,但AssemblyName设置为exe文件的名称:
'如果重命名exe,程序集名称也会更改。
)
)
)
“我试图添加以下内容,但它给我带来了一个错误
““AssemblyName”不能用作属性,因为它不是从“System.attribute”继承的
)

你知道如何设置AssemblyName吗?(我不要求在编译exe后更改它。)

AssemblyName不是属性。它是从CompilerResults.CompiledAssembly.FullName编译后自动获得的。听起来您确实想更改显示名称,请使用CompilerParameters.OutputAssembly属性。您好,Hans,谢谢!这正是我所需要的!:)