JMK
JMK

Reputation: 28059

Cleanly remove bower from an ASP.Net 5 project

I'm using the ASP.Net 5 RC, but I don't want to use bower, I want to use NPM to manage all of my dependencies.

I have removed bower.json, removed the bower install command from project.json and specifically removed each package using bower uninstall.

However, it stil shows up in the solution explorer:

Solution Explorer, with bower still present

Is there any way to properly remove it, or is this just the way ASP.Net 5 is supposed to be used?

Thanks

Upvotes: 16

Views: 3348

Answers (3)

user8604852
user8604852

Reputation: 1

Once you delete all the packages from bower and remove bower from project then you need to close and reopen vs so that the bower explorer can go away.

that's what worked for me...

Upvotes: 0

Dush
Dush

Reputation: 1365

In my case, I am using Visual Studio 2017 Community Edition. There was an empty Bower folder under the Dependancis folder that appeared with the yellow exclamation symbol. There was no option to delete it by right-clicking and selecting the context menu. But there was a folder named bower_component inside the project folder. This was excluded from the project in solution explorer, so it will only show if the Show All files button is ticked. Deleting this folder automatically removed the Bower folder located under the theDependancies node.

Upvotes: 0

JMK
JMK

Reputation: 28059

Turns out, the key is to remove the DnxInvisibleContent tag inside ItemGroup in the xproj file.

My ItemGroup section now looks like this:

<ItemGroup>
    <DnxInvisibleContent Include=".bowerrc" />
    <DnxInvisibleContent Include="package.json" />
</ItemGroup>

Upvotes: 15

Related Questions