配置文件问题,请求大家的帮助

londing 2004-09-19 11:46:41
用.net做Office 的Addin,添加了个App.config配置文件
<configuration>
<appSettings>
<add key="ApplicationName" value="MyApplication" />
</appSettings>
</configuration>
但是读不了它的值
ConfigurationSettings.AppSettings["ApplicationName"]

请大家出出主意
...全文
131 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
londing 2004-09-19
  • 打赏
  • 举报
回复
解决了,如果做的是word 的插件,把配置文件命名为WINWORD.EXE.config放到Word的安装目录下就可以了,还是要谢谢大家
saucer 2004-09-19
  • 打赏
  • 举报
回复
normally, add-in is an assembly, you cannot read configuration that way, but hey, it is an xml file, as long as you know the (relative) path of the file, you can read it through classes in System.Xml, or use someone's class library to read it

http://staff.develop.com/woodring/dotnet/#AssemblySettings
londing 2004-09-19
  • 打赏
  • 举报
回复
编译后没有自动生成对应的config文件,我手动放进去也没有用
triout 2004-09-19
  • 打赏
  • 举报
回复
没有做过OFFICE开发,不清楚。

你看编译后,是否有对应的CONFIG文件一起?比如Application.DLL.Config
happyjun2000 2004-09-19
  • 打赏
  • 举报
回复
up
swzlxm 2004-09-19
  • 打赏
  • 举报
回复
up

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧