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

编程入门 行业动态 更新时间:2024-10-27 18:19:19
本文介绍了如何从设置部署项目中排除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

本文发布于:2023-11-04 17:27:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1558559.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   app   config

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!