2012-01-16 41 views
1

我想在他們的文檔中設置一個跟在this tutorial之後的Asp.Net MVC 3站點上的Combres。ASP.NET MVC3 Combres錯誤:'System.Web.Mvc.UrlHelper'沒有包含'CombresLink'的定義

我跟所有的步驟,但是當我跑我得到以下錯誤:

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是在conbres.xml文件我的JavaScript的ResourceSet參考。 在我的web配置我:

<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。)

如何正確設置它?

在查看

回答

1

有你包括

@using Combres.Mvc 
+0

我以爲我可以把命名空間的webconfig文件。把它放在視圖中解決了這個問題。 – NetHawk 2012-01-17 18:23:19

+0

http://stackoverflow.com/questions/18254158/facing-issue-while-trying-to-cache-images-js-files-using-combres-nuget-package – 2013-08-15 14:27:06

相關問題