Is it possible to implement a self-updating ASP.NET web application?

蹲街弑〆低调 提交于 2019-12-03 13:51:07

问题


Wordpress has the capability to update itself (on admin user's request).

Is it possible to implement something similar using ASP.NET?

I can see web.config and bin folder causing problems.


回答1:


ASP.NET uses shadowcopy of dlls in your bin folder to allow you to xcopy a new set of dlls and content up to the server without those files being locked. So, dlls and web.config are not a problem.

The issue will be around having the process that runs your ASP.NET site have write access to the file system. This is generally a bad idea. You should consider putting this "auto update" functionality into the hands of a service that might run on your web server.

Check out this...

http://www.odetocode.com/articles/305.aspx

... for "What ASP.NET Programmers Should Know About Application Domains" but seriously consider the security implications of what you're suggesting. How will you stop someone from uploading evil code to your site?




回答2:


Aside from the security implication of this, yes it should be possible. But what your talking about is having the asp.net process have rights to modify all the data within its directory.

This sounds a little dangerous to me.




回答3:


web.config and the bin folder should not be a problem, you actually can edit these while an ASP.Net app is running. Existing sessions continue to see the "old" config or bin, new sessions get the new ones.

Edit: This link descibes what I mean: http://technet.microsoft.com/en-us/library/cc759560.aspx



来源:https://stackoverflow.com/questions/802736/is-it-possible-to-implement-a-self-updating-asp-net-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!