开发者

ASP.Net running in a custom appdomain

I'd like to run my ASP.Net application in a custom AppDomain, that i would create programmatically. The requests must be executed within that custom AppDomain, and not the default one.

Why would someone do that ?

The need is to cust开发者_开发技巧omize the AppDomain settings depending on the environment. Let's say the application is running on a dev machine, on a production server, in the cloud or whatever, I need to 'intercept' the first call to create the running AppDomain as needed. And I really need to do that programmatically : I don't want to perform configuration on the running plateform, the code have to be smart enought to adapt itself.

How I can detect the environment and what customization are needed is not the point here.

Thanks for your ideas !


I don't know if you can have the pages and requests/responses of your ASP.NET application running on a different appDomain than the one provided to you by IIS.

In IIS you can configure each application to run in a different AppPool but then you have to live with that.

there is not much on the Net about your specific request, I found this one: http://odetocode.com/Articles/305.aspx but it's only an introduction.

Can't you have a backend where you configure the business logic components to serve your requests depending on the custom configuration you want to use regardless the web application app domain?


Well, it all depends on the level of luxury you need. You can do that: make a small configuration readers who will abstract the loading of settings, and make a kind of "Env installer" - who will add roles and instances to cloud, or create IIS sites with System.Web.Administration classes, or in any other way. But the funny thing with that is the simple fact - you will need to configure anything you will create anyway. For example, if you creating a site that uses Azure data tables, you need to pass somehow a connection string to that or at least the management certificate and a description in code JSON or xml waht exactly you want ot get as result of "automatic configuration"....

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜