[英]How to share app.config between parent console application and ASP.NET web application
Scenario 情境
After deploying the website, I make sure that I copy consoleProject.exe.config and place it in the same bin folder as consoleProject.exe . 部署网站后,请确保我复制consoleProject.exe.config并将其放置在与consoleProject.exe相同的bin文件夹中。
Problem 问题
After deployment, If I make changes to consoleProject.exe.config , the changes are not recognized when calling methods in consoleProject.exe from the web application. 部署后,如果我对consoleProject.exe.config进行了更改, 则从 Web应用程序调用consoleProject.exe中的方法时,这些更改将无法识别。
Is this default app.config file only referred to when the actual app is being executed? 是否仅在执行实际应用程序时引用此默认app.config文件?
Yes, if you're calling code in the console app from the web app, it is treated the same as if you were calling a dll, and your web.config is used. 是的,如果您要从Web应用程序在控制台应用程序中调用代码,则将其与调用dll一样对待,并使用了web.config。
Similarly, if you call from the console application into code within a web app dll, the app.exe.config file will be used. 同样,如果您从控制台应用程序调用Web应用程序dll中的代码,则将使用app.exe.config文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.