ASP.NET MVC3 Combres 错误:“System.Web.Mvc.UrlHelper”不包含“CombresLink”的定义;

发布于 2024-12-27 10:27:55 字数 1742 浏览 2 评论 0原文

我正在尝试按照本教程 来自他们的文档。

我遵循了所有步骤,但是当我运行时出现以下错误:

编译错误

描述:资源编译期间发生错误 需要满足此请求。具体请查看以下内容 错误详细信息并适当修改您的源代码。

Compiler Error Message: CS1061: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'CombresLink' and no extension method 'CombresLink' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 5:      
Line 6:      @Sprite.ImportStylesheet("~/App_Sprites/")
--->    Line 7:      @Url.CombresLink("siteJs")
Line 8:      <script src="@Url.Content("~/Scripts/excanvas.js")" type="text/javascript"></script>
Line 9:      @RenderSection("HeadScripts", required: false)

siteJs 是 conbres.xml 文件中我的 javascript 资源集引用。 在我的网络配置中,我有:(

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
        <add type="Microsoft.Web.Samples.ImageOptimizationModule" name="Microsoft.Web.Samples.ImageOptimizationModule" />
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

这是使用与教程中提到的版本不同的 System.Web.Routing.UrlRoutingModule 版本。如果我尝试引用教程中的版本,我不能,因为我没有较旧的 DLL。)

我如何正确设置它?

I am trying to set up Combres on an Asp.Net MVC 3 site following this tutorial from their documentation.

I followed all of the steps, but when I run I get the following error:

Compilation Error

Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'CombresLink' and no extension method 'CombresLink' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 5:      
Line 6:      @Sprite.ImportStylesheet("~/App_Sprites/")
--->    Line 7:      @Url.CombresLink("siteJs")
Line 8:      <script src="@Url.Content("~/Scripts/excanvas.js")" type="text/javascript"></script>
Line 9:      @RenderSection("HeadScripts", required: false)

siteJs is my javascript resourceSet reference in the conbres.xml file.
In my web config I have:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
        <add type="Microsoft.Web.Samples.ImageOptimizationModule" name="Microsoft.Web.Samples.ImageOptimizationModule" />
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>

(This is using a different version of System.Web.Routing.UrlRoutingModule than the one referred to in the tutorial. If I try to reference the version from the tutorial I cannot because I don't have the older DLL.)

How do I set this up properly?

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

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

发布评论

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

评论(1

望她远 2025-01-03 10:27:55

在视图中你是否包含了

@using Combres.Mvc

in the View have you included

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