使用CodeDom编译c#代码(字符串形式),发现头注释
/// <summary>
///
/// </summary>
全都没了,怎么使它编译时保留注释呢?使用CodeDom图也非常郁闷,例如我想声明这样一个变量public static readonly string aaa="aaa";代码如下:CodeMemberField codefield = new CodeMemberField();
codefield.Attributes = MemberAttributes.Public;
codefield.Attributes = MemberAttributes.Static;
codefield.Name = "aaa";
codefield.Type = new CodeTypeReference(typeof(System.String));
codefield.Comments.Add(new CodeCommentStatement(注释……));编译的结果却是private static string aaa;想声明为public 和 readonly并且赋值,该怎么写?请各位高手给指点一二,谢谢了。
/// <summary>
///
/// </summary>
全都没了,怎么使它编译时保留注释呢?使用CodeDom图也非常郁闷,例如我想声明这样一个变量public static readonly string aaa="aaa";代码如下:CodeMemberField codefield = new CodeMemberField();
codefield.Attributes = MemberAttributes.Public;
codefield.Attributes = MemberAttributes.Static;
codefield.Name = "aaa";
codefield.Type = new CodeTypeReference(typeof(System.String));
codefield.Comments.Add(new CodeCommentStatement(注释……));编译的结果却是private static string aaa;想声明为public 和 readonly并且赋值,该怎么写?请各位高手给指点一二,谢谢了。
解决方案 »
- C#如何与硬件交互
- 如何让100以内的随机减法题不出现小数减大数的问题。
- 设置输入法问题
- C#进度提示窗体拖动后无法显示执行进度
- axWindowsMediaPlayer有ImageSourceHeight属性吗?
- GridView手动分页问题,请大家帮我,急!谢谢!
- 超级难的问题,先拜个早年,你们辛苦了,哈哈
- 俺想学C#,在哪下C#的IDE?哪下它的教程最好?初学有什么建议?
- 在winform中请问怎么用C#做成像sql server2000那样的导入/导出数据的向导的窗口?
- TjSell.TP2(string, int)”: 并非所有的代码路径都返回值 C:\Inetpub\wwwroot\DGWebSite\App_Code\TjSell.cs
- 用C#设置office2007 PPT中文本框的字体为“微软雅黑”无效
- winform combobox传值问题
codefield.Attributes = MemberAttributes.Public|MemberAttributes.Static;