[英]Visual Studio 2010 + ASP.Net Web Project: Looking in current folder for web.config (instead of root)
So I have been developing this application for my boss over the past few weeks and then last night the IT Administrator jacks with my machine. 因此,在过去的几周中,我一直在为老板开发此应用程序,然后昨晚IT管理员将其与我的机器配合使用。 I think the only thing he did was rename the computer name, but there could be more.
我认为他所做的唯一一件事就是重命名了计算机名称,但是可能还有更多。 Anyway, I reopen the project after getting on the computer and now the ASP.Net web project is looking into the current directory of every aspx file for a web.config instead of for the web.config in the root of the project directory (where it has been this whole time).
无论如何,我在计算机上后重新打开该项目,现在ASP.Net Web项目正在查找每个aspx文件的当前目录中的web.config,而不是项目目录根目录中的web.config(其中这是整个时间)。
Description: An error occurred during the processing of a configuration file required to service this request.
说明:在处理服务于此请求所需的配置文件期间发生错误。 Please review the specific error details below and modify your configuration file appropriately.
请查看下面的特定错误详细信息,并适当修改您的配置文件。
Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to 'C:\\*web project location*\\pages' because access is denied.
解析器错误消息:加载配置文件时发生错误:由于拒绝访问,无法开始监视对'C:\\ * web项目位置* \\ pages'的更改。
Source Error:
源错误:
[No relevant source lines]
[没有相关的源代码行]
Source File: C:\\*web project location*\\pages\\web.config
源文件:C:\\ * Web项目位置* \\ pages \\ web.config
The web.config file is located and should load under c:\\*web project location*\\web.config. 找到了web.config文件,该文件应在c:\\ * web项目位置* \\ web.config下加载。 There is no other web.config files in the project.
项目中没有其他web.config文件。 I have various folders defined in the project for different parts of the application, a folder for UserControls and for MasterPages.
我在项目中为应用程序的不同部分定义了各种文件夹,其中有UserControls和MasterPages文件夹。 If I open any aspx file from one of these sub folders, the <%@ Page %> directive says it is looking for a web.config file in that directory instead of the root of the project.
如果我从这些子文件夹之一中打开任何aspx文件,则<%@ Page%>指令表示它正在该目录中而不是项目根目录中查找web.config文件。
Please help! 请帮忙! I have been Googling and searching stack for an answer with no results.
我一直在谷歌搜索和搜索堆栈没有结果的答案。 The only details I can find related to this occurring when deploying to IIS.
我发现的唯一详细信息与部署到IIS时发生的情况有关。 I am not doing that.
我没有那样做。
Thank you in advance for your help. 预先感谢您的帮助。 It is much appreciated.
非常感谢。
I found the answer to this question. 我找到了这个问题的答案。 The Web Project was impersonating an identity.
该Web项目正在冒充一个身份。
From my web.config: 从我的web.config中:
<authentication mode="Windows" />
<identity impersonate="true" userName="DOMAIN\AppUser" password="Password" />
Not sure why the issue started occurring after the machine name was changed, but I was able to resolve the problem by adding the impersonating identity to the workstation (Win7) under Control Panel > Users > Manage Users and also by adding full permissions to the project directory for that identity. 不确定更改机器名称后为什么开始出现此问题,但是我可以通过在控制面板>用户>管理用户下将模拟身份添加到工作站(Win7)并通过向项目添加完全权限来解决此问题该身份的目录。
I also found this post which led me to an even better possible option: 我还发现了这篇文章,这使我有了一个更好的选择:
http://bytes.com/topic/asp-net/answers/309339-failed-start-monitoring-file-changes http://bytes.com/topic/asp-net/answers/309339-failed-start-monitoring-file-changes
http://support.microsoft.com/default.aspx?scid=kb;en-us;824308 http://support.microsoft.com/default.aspx?scid=kb;en-us;824308
Changing the Security Policy of the workstation should prevent future problems if other identities were used. 如果使用其他身份,更改工作站的安全策略应该可以防止将来出现问题。 I did not try this option yet however, because I have a deadline to meet.
但是,我没有尝试此选项,因为我有一个截止日期。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.