如何在中等信任中写入 Web.Config?
将我的第一个大小合适的网络应用程序上传到我的共享主机给我带来了一系列新的挑战,我的意思是,不眠之夜。 问题是,我肯定没有开发出中等信任度的应用程序(或者不知道那是什么。)
我缓解了所有问题,除了一个问题。
我已经为管理员编写了一个安装程序,以便能够指定他们的连接字符串和其他首选项,但我找不到以中等信任度写入 web.config 的方法。 有谁有解决方案,或者我应该将首选项放在另一个文件中?
Uploading my first decently sized web app to my shared host provided me with a fresh set of challenges, by which I mean, sleepless nights. The issue was that I had most certainly not developed my application for medium trust (or had any clue what that was.)
I mitigated all of the issues, save one.
I had written an installer for the admin to be able to specify their connection string and other preferences, but I cannot find a way to write to a web.config in medium trust. Does anyone have a solution, or should I just be putting preferences in another file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上听起来像是 IIS 的
低
级别。 如果是,那么您将无法写入任何文件,而不仅仅是 web.config。以下是 IIS 帮助文件中的级别:
我建议,如果您执意要安装程序,请让它在内存中创建一个
web.config
,用户可以将其保存在本地,然后再通过FTP
上传。That actually sounds like IIS's
Low
level. If it is, then you won't be able to write to any file, not just the web.config.Here are the levels from IIS's help file:
I would suggest that if you are dead set on having an installer, have it create a
web.config
in memory that the user can save locally andFTP
up afterward.