【问题标题】:Moving Visual Web Developer 2010 Express Project To A New Directory将 Visual Web Developer 2010 Express 项目移至新目录
【发布时间】:2012-08-29 20:08:39
【问题描述】:

我尝试将 VWD 项目移动到新目录,但在构建时出现以下错误:

Error   1   It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.  P:\MY DOCUMENTS\Visual Studio 2010\Projects\NetworkOperationsDashboard\NetworkOperationsDashboard\Web.config    28  

我在谷歌上搜索了解决方案,但没有一个对我有用,所以我只是在正确的目录中创建了一个新项目并添加了我所有的旧文件。但是,现在 aspx.cs 文件似乎无法读取 .aspx 文件——我不断收到很多在此上下文中找不到的符号“whatever”。 “Codefile”和“Inherits”值是正确的,但 DOCTYPE 声明带有蓝色下划线,将鼠标悬停在它上面会产生与上面大致相同的错误。

webconfig 文件的第 28 行是:

<authentication mode="Windows" />

但在我开始搬东西之前,这一切都很好。但是,如果我在没有先构建的情况下运行 Web 应用程序,则此行会引发此错误:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

我尝试在文本编辑器中编辑解决方案文件,以用新路径名替换所有旧路径名,但这并不能解决问题。

当我第一次编写这个项目时,解决方案最终位于一个目录中,而所有其他文件最终位于另一个目录中。这是我的第一个项目,所以我不确定我做错了什么。我现在只想整理一下。

感谢任何建议。

问候。

编辑:

我刚刚在正确的目录中启动了一个新项目,并将所有旧文件剪切并粘贴到新文件中。看起来这应该是万无一失的——并且错误消息消失了——但是 .aspx.cs 文件似乎仍然看不到 .aspx 文件。

【问题讨论】:

    标签: visual-web-developer visual-web-developer-2010


    【解决方案1】:

    所以我删除了 .aspx.designer.cs 文件,右键单击 .aspx 文件并选择“转换为 Web 应用程序”。不知道为什么,但这成功了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多