我正在尝试从控制台应用程序执行以下代码。
ConfigurationSection aggregatedFileSection = (ConfigurationSection)config.GetSection("Aggregation.FileAggregationConfig"); // this is inside a web.config of main web project
以下行位于web.config中。
<Aggregation.FileAggregationConfig configSource="config\common\MyAggregation.Config" />
上面的聚合在该项目的web.confg中有一个附加到它的HTTP处理程序。
<section name="Aggregation.FileAggregationConfig" type="WebProj.AggregationConfigHanler, WEBPROJ"/>
因为我正在从控制台应用程序获取配置部分,它在执行Web项目内的处理程序时找不到webproj路径。
引发错误,执行httphandler时找不到路径
如果你知道在控制台应用程序中提供路径的任何方法,请告诉我好吗