IIS / ASP.NET无法识别对web.confg的写入 [英] IIS/ASP.NET not recognizing writes to web.confg

查看:56
本文介绍了IIS / ASP.NET无法识别对web.confg的写入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我遇到了与IIS / ASP.NET相关的问题,无法识别我的Web应用程序执行的web.config写入




具体来说,我有一个Web应用程序,它提供了一个界面

,允许经过身份验证的域用户被写入网络的授权

部分.config文件。由于我使用的是集成Windows

身份验证,因此这些用户应该能够向Web应用程序发出各种

HTTP POSTS。然而,我所看到的是,我添加到web.config文件的

用户仍然是未经授权的。


IIS / ASP.NET根本就没有没有检测到对web.config文件的修改

我正在使用.NET

Configuration / WebConfigurationManager API在我的Web应用程序中以编程方式进行。


如果我在添加

用户之后使用非编程方式修改web.config文件,即使用notepad打开web.config。然后保存,

而不进行任何更改,然后IIS / ASP.NET认识到更改为

web.config,现在用户被授权使用我的网站

申请。


这是一个错误吗?


-John Gonsalves


***通过开发人员发送的指南 http://www.developersdex.com ***

解决方案




顺便说一句,我正在使用.NET 2.0并且我的Web应用程序正在运行

Windows 2003 Server企业版。


-John


***通过Developersdex http://www.developersdex.com ***

如果你的代码能够将用户添加到配置文件中,你可以尝试以编程的方式添加用户然后重新启动网站

一次,然后测试一下吗?通常web.config更改会导致网站重新加载内存以供将来点击,但是当前请求

是使用旧设置提供的。我只是采取了有根据的猜测

但是当你以编程方式修改配置文件时,

网站永远不会从内存中卸载以允许新设置采取

效果。


如果是这种情况,也许你可以尝试从另一个xml文件而不是web动态地提取用户

.config,我觉得

总是很难修改。

希望这会有所帮助。


Latish





我还没有收到有效的回复。


我试图使用的功能是允许用户=的功能。在使用集成Windows安全性的

授权部分强制执行

谁可以访问Web应用程序。


其中一项服务网络应用程序提供的是发布

a http帖子的能力,其中包括我希望提供的域/用户

授权(即它们被添加到web.config授权中)
使用Configuration / WebConfigurationMgr API的
部分。


不幸的是,IIS无法识别我对web.config所做的任何更改

以编程方式,除非我手动使用记事本打开web.config

文件并强制保存而不进行任何其他修改。 (即文件

观察者在记事本上被触发但不在

Configuration.save()上触发。


这个显然是一个错误,我需要一个解决方法!


-John Gonsalves

Hewlett Packard


***通过开发人员指南 http://www.developersdex.com 发送***


I''m experiencing problems related to IIS/ASP.NET not recognizing writes
to web.config that my web application performs.

Specifically I have a web application that provides an interface
allowing authenticated domain users to be written to the "authorization"
section of the web.config file. Since i''m using Integrated Windows
Authentication, these users should then be able to issue the various
HTTP POSTS to the web application. However what I''m seeing is that the
users I add to the web.config file still are unauthorized.

IIS/ASP.NET simply doesn''t detect modifications to the web.config file
I''m doing programmatically in my web application using the .NET
Configuration / WebConfigurationManager API.

If I use a non programatic way of modifying the web.config file after a
user has been added i.e. use notepad to open web.config. and save,
without making any changes, then IIS/ASP.NET recognise the change to
web.config and now the users become authorized to use my web
application.

Is this a bug?

-John Gonsalves

*** Sent via Developersdex http://www.developersdex.com ***

解决方案



By the way, I''m using .NET 2.0 and my web application is running on
Windows 2003 Server Enterprise Edition.

-John

*** Sent via Developersdex http://www.developersdex.com ***


If your code is able to add the users to the config file, could you
try adding the users programatically and then restarting the site
once, and then test it? Normally a web.config change causes the site
to be reloaded in memory for future hits, but the current requests
are served using the old settings. I am just taking an educated guess
but maybe when you are modifying the config file programatically, the
site never gets unloaded from memory to allow the new settings to take
effect.

If this is the case, maybe you can try picking up the users
dynamically from another xml file instead of web.config, which i think
is always tricky to modify on the fly.
Hope this helps.

Latish




I still have not received a response that works.

The feature I''m trying to use is the one where "allow users=" in the
authorization section while using Integrated Windows Security enforces
who can access the web application.

One of the services this web application offers is the ability to issue
a http post that includes a domain/user who I desire to give
authorization to (i.e. they are added to the web.config authorization
section using the Configuration / WebConfigurationMgr API).

Unfortunately IIS does not recognized any changes I make to web.config
programmatically, unless I manually use notepad to open the web.config
file and force a save without any additional modifications. (i.e. file
watcher is triggered on the notepad save but not on the
Configuration.save()).

This is clearly a bug and I need a workaround!

-John Gonsalves
Hewlett Packard

*** Sent via Developersdex http://www.developersdex.com ***


这篇关于IIS / ASP.NET无法识别对web.confg的写入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆