ASP.NET MVC3 Combres 错误:“System.Web.Mvc.UrlHelper”不包含“CombresLink”的定义;
我正在尝试按照本教程 来自他们的文档。
我遵循了所有步骤,但是当我运行时出现以下错误:
编译错误
描述:资源编译期间发生错误 需要满足此请求。具体请查看以下内容 错误详细信息并适当修改您的源代码。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在视图中你是否包含了
in the View have you included