如何从设置部署项目中排除app.config [英] how to exclude app.config from setup deployment project

查看:202
本文介绍了如何从设置部署项目中排除app.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从设置部署项目中排除app.config?

How to exclude app.config from setup deployment project?

我必须在app.config中维护加密的部分,而我所知道的唯一(半)嵌入方式是通过使用RsaProtectedConfigurationProvider或DPAPI提供程序运行代码.由于我必须运行该代码,因此出现了问题:何时运行它.由于在Windows 7下使用Rsa似乎存在一些问题(某些最终用户将没有管理员权限),我将注意力集中在依赖于机器的DPAPI上.因此,我无法在开发人员计算机上加密app.config.因此,我必须在目标计算机上执行此操作. 如果应用程序找不到任何配置文件,那么它将创建一个.那就是我想要做的:从msi安装程序项目中排除app.config,以便首次运行该应用程序,从默认设置创建设置,并在其上运行我的加密代码. 希望我足够清楚.

I must maintain encrypted sections in app.config and the only (semi) embeded way I know is by running code with RsaProtectedConfigurationProvider or DPAPI provider. Since I have to run that code the question arises: when to run it. Since there seem to be some problems using Rsa under windows 7 (some end user's will NOT have admin rights on it) I concentrated on DPAPI which is machine dependent. Therefore I can not encrypt app.config on my developer machine. So I have to do it on a target machine. If application does not find any config files, then it creates one. And that's what I am trying to do: to exclude app.config from msi setup project, so that whe app is run for the first time, settings are created from defaults and my encryption code runs on it. Hope I was clear enough.

推荐答案

在Setup Deployment项目中,可以为Primary Output文件夹输入Exclude属性:app.config

In the Setup Deployment project you could for the Primary Output folder enter in the Exclude property: app.config

这篇关于如何从设置部署项目中排除app.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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