C#-安装程序项目不使用exe的App.Config [英] C# - Installer Project does not use the App.Config of the exe

查看:292
本文介绍了C#-安装程序项目不使用exe的App.Config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试为安装程序项目(在VS 2005中)创建自定义操作,该操作将在安装完成后执行.此自定义操作指向具有App.Config文件的dll的主要输出.我已经独立测试了这个dll(通过从控制台应用程序调用),我还必须在控制台应用程序中添加dll的App.Config才能使其正常工作.

当我尝试安装安装程序时;安装后,该dll会被调用,但无法检测到App.Config文件,因此会引发找不到密钥"的错误.

如何使安装程序项目使用正在调用的dll的App.Config?

问候,
Priya.

Hi,

I am trying to create a custom action for a installer project (in VS 2005) which will get executed after the installation is completed. This custom action points to the primary output of a dll that has a App.Config file. I have tested this dll independently (by calling from a console application), i had to add the App.Config of the dll in the console application also to make it work.

When i tried installing the installer; after installation the dll is invoked but its not able to detect the App.Config file and hence throws error that "key is not found".

How can i make the installer project use the App.Config of the dll it is invoking?

Regards,
Priya.

推荐答案

您必须手动添加app.config,默认情况下不会添加.这是因为它特定于环境,并且也意味着如果有人仅执行更新但想要保留其自己的web.config,则web.config可能会被覆盖.

所以只需自己添加即可.

祝你好运!
You have to add the app.config manually, it is not added by default. This is because it is specific for the environment and would also mean that the web.config could be overwritten in case someone is just performing an update but wants to keep it''s own web.config.

So just add it yourself and that''s it.

Good luck!


这篇关于C#-安装程序项目不使用exe的App.Config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆