CSS 友好并升级到 ASP.NET 4.0

发布于 2024-09-30 12:00:50 字数 2391 浏览 0 评论 0原文

我刚刚将我们的一个 Web 应用程序升级到 ASP.NET 4.0。它使用 CssFriendly 作为菜单和一些带有树的页面。当我尝试在本地计算机(Win7 x64、IIS7)上运行时,我得到:

处理服务此请求所需的配置文件期间发生错误。请查看下面的具体错误详细信息并修改您的配置文件 适当地。

解析器错误消息:浏览器或 带 ID 的网关元素 找不到“MozillaFirefox”。

来源错误:

第 7 行:
8号线:
第 9 行:<浏览器 refID="MozillaFirefox">
第 10 行:
第 11 行:<适配器> controlType =“System.Web.UI.WebControls.Menu”

源文件: E:\RivWorks\localhost\App_Browsers\CSSMenuAdapter.browser

版本信息:
微软.NET框架版本:4.0.30319;
ASP.NET版本:4.0.30319.1

我浏览了一些解决方案,并按照 http://www.asp.net/LEARN/whitepapers/aspnet4/writing-changes 在“浏览器定义文件已更新”标题下。如果我在 VS2010 的命令窗口中运行 ASPNET_REGBROWSERS 我得到:

aspnet_regbrowsers –i
命令“aspnet_regbrowsers”无效。

所以我从命令提示符(在管理模式下)尝试了它,它似乎有效。然后我重新编译了我的应用程序并重新发布了它。我仍然遇到同样的错误。我缺少什么想法吗?


注 1: 在我的 CSSMenuAdapter.browser 文件(CSS 友好)中有一个条目:

 <browser refID="MozillaFirefox">
    <controlAdapters>
      <adapter controlType="System.Web.UI.WebControls.Menu"
               adapterType="RivWorks.Web.MenuAdapter" />
    </controlAdapters>
  </browser>

In C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\mozilla.browser 有:

<browser id="MozillaFirefox" parentID="MozillaRV">
    <identification>
        <userAgent match="Gecko\/\d+ Firefox\/(?'version'(?'major'\d+)(?'minor'\.[.\d]*))" />
    </identification>

    <capabilities>
        <capability name="browser"                         value="Firefox" />
        <capability name="majorversion"                    value="${major}" />
        <capability name="minorversion"                    value="${minor}" />
        <capability name="version"                         value="${version}" />
        <capability name="type"                            value="Firefox${version}" />
    </capabilities>
</browser>

我不明白为什么找不到它。 :(


注意 2:我注释掉了 CSSMenuAdapter.browser 文件中的浏览器元素,并且该站点再次工作。我查看了生成的代码,它在 Chrome 中看起来不错。我还在 Firefox 中查看了它,它正在工作(因为它被注释掉了,所以我很困惑)。

I just upgraded one of our web apps to ASP.NET 4.0. It is using CssFriendly for the Menu and a few pages that have Trees on them. When I try to run on my local machine (Win7 x64, IIS7) I am getting:

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: The browser or
gateway element with ID
'MozillaFirefox' cannot be found.

Source Error:

Line 7: </browser>
Line 8:
Line 9: <browser refID="MozillaFirefox">
Line 10: <controlAdapters>
Line 11: <adapter> controlType="System.Web.UI.WebControls.Menu"

Source File:
E:\RivWorks\localhost\App_Browsers\CSSMenuAdapter.browser

Version Information:
Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.1

I browsed for some solutions and followed the directions at http://www.asp.net/LEARN/whitepapers/aspnet4/breaking-changes under the “Browser Definition Files Updated“ heading. If I run ASPNET_REGBROWSERS in the command window in VS2010 I get:

aspnet_regbrowsers –i
Command "aspnet_regbrowsers" is not valid.

So I tried it from the command prompt (in admin mode) and it seemed to work. I then recompiled my app and republished it. I am still getting the same error. Any ideas what I am missing?


NOTE 1:
In my CSSMenuAdapter.browser file (CSS Friendly) there is an entry:

 <browser refID="MozillaFirefox">
    <controlAdapters>
      <adapter controlType="System.Web.UI.WebControls.Menu"
               adapterType="RivWorks.Web.MenuAdapter" />
    </controlAdapters>
  </browser>

In C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\mozilla.browser there is:

<browser id="MozillaFirefox" parentID="MozillaRV">
    <identification>
        <userAgent match="Gecko\/\d+ Firefox\/(?'version'(?'major'\d+)(?'minor'\.[.\d]*))" />
    </identification>

    <capabilities>
        <capability name="browser"                         value="Firefox" />
        <capability name="majorversion"                    value="${major}" />
        <capability name="minorversion"                    value="${minor}" />
        <capability name="version"                         value="${version}" />
        <capability name="type"                            value="Firefox${version}" />
    </capabilities>
</browser>

I am not understanding why it cannot be found. :(


NOTE 2: I commented out the browser element in the CSSMenuAdapter.browser file and the site is working again. I looked at the code that was generated and it looks good in Chrome. I also looked at it in Firefox and it is working (scratching my head on that one as it is commented out). And IE is working as well. I am so lost as to what is really broken here now!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ可否回来 2024-10-07 12:00:50

将 refID 更新为“Firefox”。这对我有用,因为在 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\mozilla.browser 中
ID 是 Firefox,而不是 MozillaFirefox。

update refID to just "Firefox". that worked for me because in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Browsers\mozilla.browser
Id is Firefox not MozillaFirefox.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文