Skip to content

HtmlHelper does not contain a definition for Bootstrap #441

@gwaz

Description

@gwaz

I have an existing WebApi2 + MVC solution to which I have installed TwitterBootstrapMVC5 following the instructions and added my license file.

Razor does not detect Bootstrap:
'HtmlHelper' does not contain a definition for 'Bootstrap' and no extension method 'Bootstrap' accepting a first argument of type 'HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

I've ensured Bootstrap.Configure() is executed. At runtime I get:

Compiler Error Message: CS1963: An expression tree may not contain a dynamic operation

for

Line 10:     @(Html.Bootstrap().LabelFor(m => m.UserName)
Line 11:     .LabelText("Username")
Line 12:     .ShowRequiredStar(true))

TwitterBootstrapMVC5 and T4MCXExtensions are referenced. I've tried to restart Visual Studio but nothing helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions