Foldertype of wwwroot from ASP.NET Core and use it in MVC 5
Asked Answered
Q

1

7

I manage all my plugins in my ASP.NET MVC application with bower.

The problem: Bower works great, but when it installs the plugins, I don't see them in my solution. I'd have to show all files (which is not updated automatically) and then include them, which then causes problems when I update them again...

What I want: ASP.NET Core projects have a special folder for the wwwroot, which automatically makes the file visible in the solution, when it's created e.g. in the File Explorer.

What I tried: Edit the .csproj to 'lablabla\bower_components\** This only included the files at startup and some changes in the project replaced the **(Source).

enter image description here

Quintessence answered 16/8, 2016 at 11:31 Comment(4)
You probably know this discussion (months ago), but let it be here for the record: #32783658 and for anyone else that is trying to come up with a decision about this one.Verde
No, I didn't know that. Still doesn't answer what kind of folder the wwwroot is and if I can use it in MVC 5. However I edit my question so it says that in the title tooQuintessence
The wwwroot folder is just s special folder in the world of .Net Core and no, you can't have this in MVC5. It may be possible with some sort of addon though.Ethylethylate
A plugin would be fine too :)Quintessence
U
0

I didn't try it yet, but you can try to use "Post Build" event to copy this folder.

Click on Project->Properties->Build Events->Post Build

And try to use "copy" or "xcopy" using keywords like $(SolutionDir) and $(TargetDir) or the absolute paths

An example:

xcopy "$(SolutionDir)xxxxx\bower_components" "$(TargetDir)\" /S /Y

Another example:

xcopy "c:\MyProject\xxx\bower_components" "c:\MyOtherProject\wwwroot\" /S /Y
Ultramarine answered 23/8, 2016 at 20:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.