开发者

Getting path not found error while executing GetConfig section from a console app

I am trying to execute the below code from a console app.

ConfigurationSection aggregatedFileSection = (ConfigurationSection)config.GetSection("Aggregation.FileAggregationConfig");  // this is inside a web.config of main web project

The below line is in web.config.

<Aggregation.FileAggregationConfig configSource="config\common\MyAggregation.Config" />

The above aggregation has a http handler attached to it in web.confg inside that project.

<section name="Aggregation.FileAggregationConfig" type="WebProj.AggregationConfigHanler, WEBPRO开发者_Python百科J"/>

As I am getting the config section from console app and it is unable to find the Webproj path while executing handler which is inside web project. and throwing error , path cannot found while executing httphandler

Can you please let me know if you know any way to give path in the console app


Your config file will be read from your active project and in this case is your console app config file. you should embed items in web.config in your console app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜