我的ASP.NET MVC评估需要在启动时和在定期间隔中承担一系列任务。 作为控制者行动,我执行了每一项任务,并列举了在数据库中采取行动的相对途径。 我实施了从数据库中获取圆顶的“任务”程序,并请求每台定期使用网络查询。 创建,但这一条 throw下了“UriFormatException。 我不能使用。 该回答,或任何在<代码>HttpContext.Current.Request上标有“Request is not available in this context”的“HttpExcept的代码。 由于我的代码使用<条码>System.Threading.timer进行背景处理,因此没有申请标语,如建议here。 我的问题是:
- Is there really no way to make local web requests within an ASP.NET web app?
- Is there really no way to dynamically ascertain the root path to the web app even using static dependencies in ASP.NET?
- I was trying to avoid storing the app s root path in the database (as FogBugz does with its "Maintenance Path"), but is this best option?