how to exclude app.config from setup deployment project

℡╲_俬逩灬. 提交于 2020-01-05 05:25:07

问题


How to exclude app.config from setup deployment project?

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.


回答1:


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




回答2:


In Visual Studio, could you change the app.config -> properties -> Build Action from "Content" to "None"?



来源:https://stackoverflow.com/questions/4794399/how-to-exclude-app-config-from-setup-deployment-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!