C# Web.Config中配置节文件的相对路径

C# Web.Config中配置节文件的相对路径,c#,web-config,relative-path,configsection,C#,Web Config,Relative Path,Configsection,我在一个文件夹中有几个控制台应用程序和一个MVCWebAPI应用程序。是否所有这些应用程序都可以引用驻留在父文件夹中的constants.config文件? 在所有应用程序的每个Web.config文件中,我声明了以下配置部分: <configSections> <section name="Constants" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.0.0, C

我在一个文件夹中有几个控制台应用程序和一个MVCWebAPI应用程序。是否所有这些应用程序都可以引用驻留在父文件夹中的constants.config文件? 在所有应用程序的每个Web.config文件中,我声明了以下配置部分:

<configSections>
 <section name="Constants" type="System.Configuration.NameValueFileSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<Constants file="~/Constants.config">

但应用程序不会读取Constants.config。如何正确给出路径