Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown server tag 'webopt:BundleReference'

Tags:

asp.net

I have developed a web form in ASP.Net 4.5 using Visual Studio 2012 for Web Express. It is hosted on somee.com. When the page loads I get the following error:

Server Error in '/' Application.

Parser Error

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

Parser Error Message: Unknown server tag 'webopt:BundleReference'.

Source Error: 


Line 9: <%: Scripts.Render("~/bundles/modernizr") %>
Line 10: </asp:PlaceHolder> 
Line 11: <webopt:BundleReference runat="server" Path="~/Content/css" /> 
Line 12: <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
Line 13: <meta name="viewport" content="width=device-width" />

Source File: /Site.Master Line: 11 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET  Version:4.0.30319.17929
like image 769
te7 Avatar asked Jun 16 '13 07:06

te7


3 Answers

You'll need to ensure that you have a reference to the specific assembly that is related to your "webopt" files. Typically, you can do this by including it within the section of your web.config file :

<pages>
    <controls>
        <add tagPrefix="webopt" assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms"  />
    </controls>
</pages>
like image 110
skhurams Avatar answered Oct 05 '22 23:10

skhurams


It's simpler than that actually. Simply run this on Nuget: Install-Package Microsoft.AspNet.Web.Optimization.WebForms

like image 20
l3ny Avatar answered Oct 06 '22 01:10

l3ny


Bundling and minification can be turned on simply by setting the debug attribute to false in web.config.

like image 28
Ali.Ghodrat Avatar answered Oct 06 '22 01:10

Ali.Ghodrat