erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

A namespace cannot directly contain members such as fields or methods #79

Open bdelaney opened 11 years ago

bdelaney commented 11 years ago

This error on build out of the Nuget Templates package, ControllerWithContext.tt showing a .cs output and that is source of error. Used latest Nuget packages (all 3) in an MVC4 project, Empty template. This occurred after the recommended project close and reopen.

Deleted the ControllerWithContext.cs output file and build works.

After installing the 3 NuGet packages, Package Manager GUI shows 4 packages, all are 1.0.90 version. Makes sense as I look at packages.config file and note what has been installed:

Looking forward to checking it out further.

serra commented 11 years ago

There seems to be missing some relevant information from your bug report. What has been installed?

MilkyWayJoe commented 11 years ago

I'm having the exact same issue.

I am using the MVC4 Internet Application Template.

I've installed the packages in this order:

PM> install-package twitter.bootstrap.mvc4 PM> install-package twitter.bootstrap.mvc4.sample PM> install-package twitter.bootstrap.mvc4.templates PM> install-package twitter.bootstrap.mvc4.templates.htmlhelpers

By the time it installed the "templates" I could see 3 items in my errors list: Untitled

I have installed the HTML Helpers with no problems

serra commented 11 years ago

Hmm, I'll try this out. By twitter.bootstrap.mvc4.templates.htmlhelpers, I assume you mean twitter.bootstrap.mvc4.htmlhelpers? Note that the htmlhelpers package already should be installed with the sample too.

serra commented 11 years ago

This is because the custom template of CodeTemplates\AddController\ControllerWithContext.tt is not cleared.

Workaround for now ( @bdelaney and @MilkyWayJoe ) is to simply clear the Custom Tool in the file property window.

This is a valid bug report though - afaik the Custom Tool property was automatically cleared in earlier releases.

serra commented 11 years ago

Correction: I fixed this as part of #29, but that is pull request is still open. @erichexter or @MisterJames please consider merging #29.

erichexter commented 11 years ago

Im traveling and will be iffline foe the next two weeks.

James can you apply the pr? On Mar 9, 2013 8:41 AM, "Marijn van der Zee" notifications@github.com wrote:

Related: #29https://github.com/erichexter/twitter.bootstrap.mvc/issues/29and

57 https://github.com/erichexter/twitter.bootstrap.mvc/issues/57.

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/79#issuecomment-14664038 .

MilkyWayJoe commented 11 years ago

@serra yeah, I wrote it incorrectly here, but I've actually installed twitter.bootstrap.mvc4.htmlhelpers